Use this guide to add custom event tracking to your SoCast website. 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 on the right that contains an ID starting with a hash (#), for example: #listenBtn
.
Add the following code to the Website Custom Footer HTML section. Replace #listenBtn
with the element ID 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.