Track JetPack Shares in Google Analytics

The JetPack plugin makes it easy to add share buttons to posts in WordPress. With a little custom code it’s also possible to track how often the share buttons are clicked and which URLs are being shared.

social

Here’s an example of the javascript needed to track shares for Twitter and Facebook:

https://gist.github.com/devinsays/e9a5a42c1416b16f8bae

This code assumes jQuery is available. The code can be added to an existing javascript file or enqueued separately.

To view the data in Google Analytics, go to “Acquisition > Social > Plugins”.

You can also read more about social interaction tracking in the Google Analytics documentation.

About Devin

I am a developer based in Austin, Texas. I run a little theme shop called DevPress and help manage a WooCommerce shop with Universal Yums. Find me on twitter @devinsays.

1 Response

Leave a Reply