Integration with Google Analytics 4

Created on 10 January 2023, almost 2 years ago

Hello addtoany users!

The integration of version 8.x-1.16 and Drupal 9 with Google Analytics (Universal Analytics) works perfect.

But, with new and obrigatory version of Google Analytics 4.0 , the events from shared buttons are not sended to Google Analytics anymore.

Do anybody knows any kind of documentation (like this) or update from this module to new Google Analytics version?

Thanks in advance.

Feature request
Status

Active

Version

1.16

Component

Documentation

Created by

🇧🇷Brazil adao.boscolo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇷Brazil adao.boscolo

    I solved the integration with GA4.

    This is the step by step for Google Tag Manager:

    Create two new data variables

    AddToAny - socialTarget
    Name: socialTarget
    Version: 2

    AddToAny - socialAction
    Name: socialAction
    Version: 2

    Create a new trigger
    AddToAnyShare

    Trigger type:
    custom event

    Event name:
    AddToAnyShare

    Create a new tag
    AddToAny

    tag type:
    GA4 event

    Configuration tag:
    (your GA4 account tag)

    Event name:
    share

    Event Parameters:
    Parameter name: method
    Value: {{AddToAny - socialAction}}

    Parameter name: content_type
    Value: {{AddToAny - socialTarget}}

    Triggers
    AddToAnyShare

    The data will be available in the real-time report (card: Event count by Event Name).

Production build 0.71.5 2024