Search
Skip to content
  • Knowledge Base
Add-Ons, Social Sharing Analytics

How to Track Social Share with Google Tag Manager

admin

If you are using Sassy Social Share, Super Socializer or Sassy Social Share Premium plugin for Social Share, follow the steps mentioned below to track Social Share with Google Tag Manager.

  1. If using Sassy Social Share or Super Socializer, download, install and activate Social Sharing Analytics add-on or if using Sassy Social Share Premium, navigate to Sassy Social Share Premium > Social Analytics Sharing options page from left sidebar in admin area.
  2. Choose “Yes, I am using Google Tag Manager” in “Already using Google Analytics” option at add-on options page in admin area and save changes.
  3. Navigate to https://tagmanager.google.com and login to your account, if not already logged in.
  4. Select the container you are using for your website, by clicking on the container name (We are assuming that you have already created a container to enable Google Analytics at your website).Google Tag Manager Container
  5. Click Variables in the left sidebarGoogle Tag Manager Variables
  6. Click Configure button in the right side, scroll down and tick mark all the checkboxes in Clicks section. Close this sectionGoogle Analytics - Built-in Variables ConfigureGoogle Tag Manager Variables Clicks
  7. Click New button in the User-Defined Variables section
    Google Tag Manager New Variable
  8. Name this variable Social Network. Click “Choose a variable….” to configure it.Google Tag Manager Variable Configuration
  9. Select Custom Javascript in Choose variable type section. Click Continue button.Google Tag Manager Choose Variable Type
  10. If using Super Socializer, Sassy Social Share, Sassy Social Share Premium or Sassy Social Share Pro, place following Javascript in Custom Javascript option and click Save button:
    function(){
        var p = {{Click Element}};
        if(p.hasAttribute('title')){
            return p.getAttribute('title');
        }
        do{
            var o = p;
            p = o.parentNode;
        }
        while(!p.hasAttribute('title'));
        return p.getAttribute('title');
    }
    

    Google Tag Manager - Social Network Configure Variable

  11. Create another variable as done in step 7 and name it Social Target. Select Custom Javascript in Choose Type option. Place following Javascript in Custom Javascript option:
    If using Sassy Social Share plugin:

    function(){
        var p = {{Click Element}}.parentNode;
        do{
            var o = p;
            p = o.parentNode;
        }
        while(!p.classList.contains('heateor_sss_sharing_container'));
        return p.getAttribute('data-heateor-sss-href');
    }
    

    If using Super Socializer plugin:

    function(){
        var p = {{Click Element}}.parentNode;
        do{
            var o = p;
            p = o.parentNode;
        }
        while(!p.classList.contains('the_champ_sharing_container'));
        return p.getAttribute('data-super-socializer-href');
    }

    If using Sassy Social Share Pro or Sassy Social Share Premium plugin:

    function(){
        var p = {{Click Element}}.parentNode;
        do{
            var o = p;
            p = o.parentNode;
        }
        while(!p.classList.contains('heateor_sssp_sharing_container'));
        return p.getAttribute('data-heateor-sssp-href');
    }

    Click Save button.Google Tag Manager - Variable Social Target

  12. Click Triggers in left sidebar. Add a new trigger by clicking on New button. You can name it something like “Sassy Social Share” or “Super Socializer Share” depending on the plugin you are using.Google Tag Manager New Trigger
    Click “Choose a trigger type to begin setup”.
    Google Tag Manager Choose Trigger Type
    Choose All elementsGoogle Tag Manager All Elements
  13. Configure the trigger as shown in the screenshot below. Enter “heateor_sss_” (if using Sassy Social Share), “heateor_sssp_” (if using Sassy Social Share Pro, Sassy Social Share Premium)  OR “the_champ_“ (if using Super Socializer) in “Starts with” option. Click Save buttonGoogle Tag Manager - Trigger Starts With
  14. Click on Tags in the left sidebar.Google Tag Manager - Tags
  15. Create a new tag by clicking the New button (we are assuming that you have already created Google Analytics tag)Google Tag Manager New Tag
  16. Name it Sassy Social Share, Sassy Social Share Pro/Premium or Super Socializer. You are free to give it any name. Click on “Choose a tag….” to configure it.Google Tag Manager Tag Name
  17. Choose Google Analytics: GA4 EventGoogle Analytics - GA4 Event
  18. Select the Configuration tag that you have already created for Google Analytics OR if you have not created any such tag, you can choose None – Manually Set ID and specify the Measurement ID associated to the Google Analytics property that you will use to track the social shares Google Tag Manager - Configuration Tag
  19. Type share in the Event name option. Click Event Parameters section. Add a row with Network as Parameter Name and click (+) icon to select {{Social Network}} in the Value option. Add another row with Target URL as Parameter Name and click (+) icon to select {{Social Target}} in the Value optionGoogle Tag Manager - Event Parameters
  20. Click “Choose a trigger….” sectionGoogle Tag Manager - Choose a Trigger
  21. Select the trigger you created in step 11 above (we named it Sassy Social Share) and click Save button.Google Tag Manager Choose Trigger
  22. Create Tag by clicking the Save buttonGoogle Analytics - Create Tag
  23. Click Submit button in top-right cornerGoogle Tag Manager Submit
  24. Click Publish button. Your changes are live now.Google Tag Manager Publish
  25. You can see the shares being tracked in the Reports > Engagement > Events section in your Google Analytics dashboard after 24 hours (minimum) after making above changesGoogle Analytics - Engagement Events
Google AnalyticsGoogle Analytics IntegrationGoogle Tag ManagerSocial ShareTrack Social Share

Post navigation

Previous PostWhy Is Floating Share/Like Button Not Appearing At Homepage?Next PostWhy is sharer not showing the correct image, title and other meta tags content?

Get Social!!

Best social tools to boost user engagement at your WordPress website. Used by 150000+ websites

Try it now
Facebook
© 2025 Heateor | Terms | Privacy
Proudly powered by WordPress