This article is intended for advanced users who want to add custom event tracking to their SoCast websites. You will need access to the Website Settings panel.
For more information on using Google Analytics event tracking, visit the official documentation: Google Analytics Event Tracking Guide.
Identify the button on your website that you want to track.
Right-click the button and select Inspect Element to open your browser’s developer tools.
In the element’s path (see screenshot below), locate the last element to the right that contains a hash tag (e.g., #listenBtn
).
Add the following code to the Website Custom Footer HTML section. Replace #listenBtn
with the element name you found in the previous step:
<script> $("#listenBtn").click(function() { ga("send", "event", "player", "listen"); }); </script>
This code will send an event to Google Analytics every time the button is clicked.
Once you have added the code and saved your changes, Google Analytics will begin tracking the specified event on your website.