Back to Community

Troubleshooting AddToAny Share Buttons with Google Analytics & Google Tag Manager

13 threads Sep 16, 2025 PluginAddtoany share buttons

Content

Integrating AddToAny Share Buttons with Google Analytics (GA) or Google Tag Manager (GTM) is a powerful way to track social shares. However, users often encounter issues where data doesn't appear in their reports. This guide covers the most common problems and their solutions, based on community discussions.

Common Problems and Solutions

1. Events Not Showing in Google Analytics

Problem: You've set up tracking, but share events are not visible in your Google Analytics reports.

Why it happens: This is often a misunderstanding of where the data appears. The 'AddToAny Share Buttons' plugin can send data to different reports depending on your setup.

Solution: Check the correct report in Google Analytics. If you are using the standard GA integration, look under Behavior > Events > Top Events. The event Category is typically "AddToAny". If you are using Google Tag Manager (gtm.js), the data often appears in the Acquisition > Social > Plugins report, not the standard Events overview.

2. Google Tag Manager Setup Issues

Problem: GTM requires a Tracking ID or other configuration, and the instructions are unclear.

Why it happens: GTM's interface has evolved, and the required fields can be confusing.

Solution: When creating a tag in GTM, you can often skip the "Google Analytics Settings" variable field. Instead, check the option for "Enable overriding settings in this tag" and manually enter your GA Tracking ID (e.g., UA-XXXXXXXX-X) in the field that appears. You do not need to select one of the socialAction/socialNetwork/socialTarget variables for this setting.

3. Additional JavaScript Configuration

Problem: You are unsure if custom JavaScript code is needed or where to place it.

Why it happens: Older setup guides may include code snippets that are no longer necessary for all users.

Solution: For most users, the built-in integration is sufficient. If you need advanced GTM tracking, you can add a callback function. In your WordPress dashboard, go to Settings > AddToAny and paste the code into the "Additional JavaScript" box. You can omit the first two lines (var a2a_config...) as the plugin handles that.

a2a_config.callbacks.push({
    share: function(data) {
        dataLayer.push({
            'event': 'AddToAnyShare', 
            'socialNetwork': 'AddToAny', 
            'socialAction': data.service, 
            'socialTarget': data.url
        });
    }
});

4. Disabling the Default Google Analytics Integration

Problem: You have another tracking method and need to disable AddToAny's automatic GA event tracking to avoid duplicate data.

Solution: Add the following code to the "Additional JavaScript" box in the AddToAny settings. This will disable the plugin's built-in GA tracking without affecting other functionality.

a2a_config.callbacks.push({
    ready: function() {
        if (a2a.GA && a2a.GA.track) {
            a2a.GA.track = function(){};
        }
    }
});

5. Plugin Conflicts

Problem: Other plugins, like 'Site Kit by Google', may conflict and cause the Google Analytics code to be removed from pages where sharing buttons are hidden.

Solution: If you encounter this rare conflict, consider using a different Google Analytics plugin or managing the GA code directly instead of through 'Site Kit'.

Checking if Your Setup is Working

Use the Google Tag Assistant preview mode or browser developer tools to verify that the dataLayer.push event fires correctly when a share button is clicked. Remember that data can take up to 24-48 hours to fully populate in your Google Analytics reports.

By following these troubleshooting steps, you should be able to resolve most common issues with tracking social shares from AddToAny buttons.