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.
- Download, install and activate Social Sharing Analytics add-on or navigate to Sassy Social Share Premium > Social Analytics Sharing options page from left sidebar in admin area.
- 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.
- Navigate to https://tagmanager.google.com and login to your account, if not already logged in.
- 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).
- Click Variables in the left sidebar and tick mark all the options in Clicks section. If you are not seeing following screen, check the next screenshots. Click New button.
- Name this variable Social Network. Click “Choose a variable….” to configure it.
- Select Custom Javascript in Choose variable type section. Click Continue button.
- If using Super Socializer, place following Javascript in Custom Javascript option and click Save button:
function(){ var p = {{Click Element}}.parentNode; if(p.classList.contains('theChampSharing')){ return p.getAttribute('title'); } do{ var o = p; p = o.parentNode; } while(!p.classList.contains('theChampSharing')); return p.getAttribute('title'); }
If using Sassy Social Share, place following Javascript in Custom Javascript option and click Save button:
function(){ var p = {{Click Element}}.parentNode; if(p.classList.contains('heateorSssSharing')){ return p.getAttribute('title'); } do{ var o = p; p = o.parentNode; } while(!p.classList.contains('heateorSssSharing')); return p.getAttribute('title'); }
If using 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}}.parentNode; if(p.classList.contains('heateorSsspSharing')){ return p.getAttribute('title'); } do{ var o = p; p = o.parentNode; } while(!p.classList.contains('heateorSsspSharing')); return p.getAttribute('title'); }
- Create another variable 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('heateor-sss-data-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('super-socializer-data-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('heateor-sssp-data-href'); }
- 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.
Click “Choose a trigger type to begin setup”.
Choose All elements - Configure the trigger as shown in the screenshot below. Enter “heateorSssSharing” (if using Sassy Social Share), “heateorSsspSharing” (if using Sassy Social Share Pro, Sassy Social Share Premium) OR “theChampSharing“(if using Super Socializer) in “Starts with” option. Click Save button
- Click on Tags in left sidebar.
- Create a new tag by clicking New button (we are assuming that you have already created Google Analytics tag)
- 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.
- Configure the tag as shown in the screenshot below.
Enter the same Tracking ID as saved in the Google Analytics tag you have created already for the website. After configuring it, click “Choose a trigger….” section.
- Tick mark the trigger you created in step 11 above (we named it Sassy Social Share) and click Save button.
- Create Tag by clicking the Save button.
- Click Submit button in top-right corner
- Click Publish button. Your changes are live now.
- You can see the shares being tracked in the Acquisition > Social > Plugins section in your Google Analytics dashboard after 24 hours (minimum) of making above changes.