• Resolved cheonmu

    (@cheonmu)


    Hi,

    I read ” https://www.addtoany.com/ext/google_analytics/” and setup GTM events already .

    but i tested social share tracking, doesnot work. event tracking not work.

    do i must add below code on my website? if need to added, where do i put this code?

    my website is https://seoartgallery.com.

      var a2a_config = a2a_config || {};
        a2a_config.callbacks = a2a_config.callbacks || [];
        a2a_config.callbacks.push({
            share: function(data) {
                // Track shares in Google Analytics with Google Tag Manager
                dataLayer.push({
                    'event': 'AddToAnyShare', 
                    'socialNetwork': 'AddToAny', 
                    'socialAction': data.service, 
                    'socialTarget': data.url
                });
            }
        });"

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author micropat

    (@micropat)

    Add the code to your “Additional JavaScript” box in Settings > AddToAny.

    You can skip the first 2 lines for WordPress plugin, so just use:

    a2a_config.callbacks.push({
        share: function(data) {
            // Track shares in Google Analytics with Google Tag Manager
            dataLayer.push({
                'event': 'AddToAnyShare', 
                'socialNetwork': 'AddToAny', 
                'socialAction': data.service, 
                'socialTarget': data.url
            });
        }
    });
    Thread Starter cheonmu

    (@cheonmu)

    @micropat

    Hi, Thanks for answering!

    I put that code in Addtional JS box and tested using GTM preview tool.

    Social event is tracking in GTM but not showing any events at Behavior > Events > Overview in GA.

    Could you tell me what do i check again?

    Thank you.

    Thread Starter cheonmu

    (@cheonmu)

    Oh, I fount what is problem.

    Problem is sovled. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add to any with GTM.’ is closed to new replies.