How Do I Add Google Analytics Tracking Code to My SoCast Player?

How Do I Add Google Analytics Tracking Code to My SoCast Player?

How Do I Add Google Analytics Tracking Code to My SoCast Player?

Note: Adding Google Analytics tracking code to your station’s website will not automatically track your SoCast player. To track analytics for your player, you must follow the steps below in addition to setting up tracking for your website.

Step-by-Step Instructions

  1. Create a Google Analytics Account: If you don’t already have one, follow the instructions here: Create a Google Analytics Account.
  2. Set Up a Web Property: Learn how to set up a property for your player: Set Up a Property.
  3. Create Your Tracking Code: Follow these instructions to generate your tracking code: Get Your Tracking Code.
  4. Add the Tracking Code to Your Player:
    • Go to your SoCast Player Admin: Player Custom HTML.
    • Paste your Google Analytics tracking code as the last item in the Custom Footer HTML section. (It can also be placed in the Custom Header section, but the Footer is recommended.)
    • Your code should look similar to the example below (replace UA-1234567-12 with your own UA ID):
    <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
    
    ga('create', 'UA-1234567-12', 'auto');
    ga('send', 'pageview');
    </script>
    

Important Notes

  • Allow up to 24 hours for your analytics data to appear. If you do not see results after this time:
    • Double-check that you copied and pasted the full tracking code.
    • Ensure the UA ID matches the one associated with your website.
    • If you still experience issues, please contact SoCast Support.
  • When pasting code into the Custom Header HTML, be careful not to interfere with any other code in that section.