Since I recently set up my blog, I decided to use Jetpack’s sharing widgets on all of my post pages. It’s super easy to set up and I didn’t feel like using the traditional native sharing widgets from the social networks. The only downfall of this route is that it doesn’t display the share count, but it’s a very good option for those that don’t want to touch the code.

In this post, we’ll take a detailed look at how to set up and track social sharing using Google Tag Manager and Jetpack by WordPress.

1. Decide which social networks to include

After you’ve installed Jetpack, go into Settings > Sharing to set the social networks you wish to add. In this case, I’ve added Twitter, Google+, Facebook, LinkedIn and Email. Apply the other settings below and save changes. Now your social sharing widgets should be appearing on the pages specified in the settings.

Screen Shot 2015-10-24 at 3.15.30 PM

2. Create a trigger for each button

Luckily, Jetpack does a good and consistent job using class names for each of the buttons. Each button contains a class that corresponds with the social network. For example, the Twitter button contains ‘twitter’ in the clicked class, and the Facebook button contains ‘facebook’ in the clicked class.

We’ll want to create a click event trigger for each social network and fires when the click classes contain the name of the social network.

Below is an example for Twitter:

Screen Shot 2015-10-24 at 3.25.26 PM

Do the same for any other social network you add to your blog. Double check the class by inspecting the element.

3. Create a tag for each button

Just like we did with the triggers, we’ll need to do the same for the tags. Create a new Google Analytics tag where the track type equals social, using the following social tracking parameters:

  • Network: Name of social network. Ex: Twitter
  • Action: Share
  • Action Target: {{Page URL}}

Below is an example for Twitter:

Screen Shot 2015-10-24 at 3.30.36 PM

Add the trigger that corresponds with the social network. In this example, it’ll be the same trigger I created in the previous step.

4. Test

Go into preview mode and navigate to one of your blog posts. Click on the social sharing icon that you implemented and make sure the tag is firing off. Within that tag, make sure each of the three social sharing parameters are being passed in correctly.

Below is a Twitter example from my website:

Screen Shot 2015-10-24 at 3.35.36 PM

You should also see this data populating in your reports.

Screen Shot 2015-10-24 at 3.37.56 PM

5. Organize (optional)

Since this exercise required creating multiple tags and triggers, I recommend putting them all in a folder that you can easily access at a later time. Over time, your larger GTM implementations can get hefty, and it helps to keep things organized.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.