In https://jira.greenpeace.org/browse/PLANET-1501 we got rid of the AddThis Toggle button for social sharing, which in the original KPI extraction setup was firing Social Sharing events in GA UA-10290164. The AddThis was replaced by pure HTML Share Buttons - https://schier.co/blog/2014/10/22/pure-html-share-buttons.html but ONLY on two specific content groups:
- **Posts (so everything with URLs https://www.greenpeace.org/international/story/ and beyond)
- **Take Action (evertyrhitng with https://www.greenpeace.org/international/act/ and beyond)
Anton from PRECIS recommended the way forward:
"I would suggest an onclick dataLayer.push that relies on the Generic Event Tag that I've described in the Implementation Guide - https://docs.google.com/document/d/1VPRTuojEl-iHtgSf7LNlp6DHLF9u1SH6K0pmNX6LDxQ/edit#heading=h.9rctk927bhkf".
basically, the DataLayer.push should be embedded in the buttons code (below)
dataLayer.push({
'event' : 'uaevent' //do not alter this name
'eventCategory' : 'Social Share' //The Event Category to be sent to GA
'eventAction' : '[variable]' //Facebook/Twitter/Email
'eventLabel' : '[variable]' //Optional, could be current URL
});
This would automatically collect the "click" event, and send it to Google Analytics using the configuration of GTM that is al ready in place.
- relates to
-
PLANET-4917 Have auto-generated bit.lys / UTM values to P4 share buttons
- CLOSED