Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-1818

Add dataLayer in NEW Social Sharing buttons

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Should have Should have
    • 1.5.0
    • 3
    • Sprint #29, Sprint #30

      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: 

      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.

       

            nroussos Nikos Roussos
            ltiralon Luca Tiralongo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: