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

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>
             

    • Related Articles

    • How Do I Use The Page Analytics (By Google) Chrome Browser Extension ?

      This Article Is For: Users with access to a Google Analytics ( GA) account. Notes: For more information on the Page Analytics Chrome Extension click here: https://support.google.com/analytics/answer/6047802?hl=en For all other Google Analytics ...
    • Website Settings General

      This Article Is For: All users who have the 'Manage Website Settings' permission This is applicable to: all SoCast Themes Website Settings are broken down into the following modules: Website Vitals How Do I Enable Accelerated Mobile Pages (AMP) For ...
    • Event Settings

      This Article Is For: All users who have the 'Manage Website Settings' permission This is applicable to the SoCast 2.0 Theme and Hero 1.0 Theme Learn More : How Do I Add Custom Header HTML To Event Calendars? How Do I Add Custom Footer HTML To Event ...
    • How do I add Google Analytics to my website?

      NOTE: If you have the SoCast player, you will need to add it to your player settings as well. Click on the link below this text with the tracing code copied, and you can follow the instructions from Step 5. Adding Google Analytics code to your player ...
    • How Do I Track Individual URL's On My Website Using Bit.ly?

      This Article Is For: Users with a bit.ly account Visit https://bitly.com/a/sign_up to create an account Bit.ly is a free service with a limit of up to 10,000 Total Short URLs (bitlinks) and up to 500 Branded Bitlinks and a 30 day tracking view. ...