How Do I Add Google Analytics Event Tracking To My Website?

This Article Is For:

  • All users who have the 'Manage Website Settings' permission
  • This is applicable to: All Themes

For additional information on how to use GA event tracking, see this article: https://developers.google.com/analytics/devguides/collection/analyticsjs/events

This article is intended for advanced users that want to add custom event tracking to their SoCast websites.  It requires access to the Website / Settings panel.  

Step-by-step guide

To add event tracking follow these steps:

  1. Find a button from your website that you wish to track

  2. Right click that button and select "Inspect Element"

  3. In the path of the element (see attached screenshot), find the last element to the right containing a hash tag, e.g. "#listenBtn"


  4. Put the following code in the 'Website Custom Footer HTML' section with the element name placed in the first brackets in the second line (in this case "#listenBtn"):
    <script>
    $("#listenBtn").click(function() {
    ga("send", "event", "player", "listen");
    });
    </script>

 

Filter by label

There are no items with the selected labels at this time.