Google Analytics Tracking of Audio Widgets

Hi there, I need some help on how to track plays of the audio player widget across multiple URLs and domains.

As you probably know, Elfsight frustratingly doesn’t allow members to track plays of audio players - just the number of time it loads on any one domain. My business needs to be able to track plays, however, in order to demonstrate to our clients that audio players are something worth using.

Elfsight has said it will provide GA code to track plays, however I’m unsure of exactly how this works, and Elfsight hasn’t been particularly helpful. Any insight anyone could give would be really appreciated! Specifically:

-How does the code work? Is it one piece of code per domain, which can be used for any player embedded within that domain (on different URLs)? Or is it a different code for every audio player within the domain?

-How do you add the GA code to the website? Is it Google Tag Manager? Can our clients add the code themselves?

-Who can access the tracking data - just whoever has a GA login for that particular domain?

Thanks - any help would be greatly appreciated!


Hello @user627 and we are happy to see you at Elfsight Community! Welcome :tada:

I see that you’ve opened ticket a 301335 and our support agent Irene has already answered all your questions.

She said that if you use the same layout in your widgets, the code for Google Analytics will work for all the Audio Player widgets so you won’t need to contact us every time for the new code.

Here’s how you need to add the code to your website.

Please add this part of the code to your website :

Where you need to replace UA-ID with your actual website ID for Google Analytics (this custom code will work with G4 as well).

And then just add the rest of the script right before closing tag:

If you need to track the number of clicks on the widgets installed on different pages, you need to add the first part in the head only once, and then you need to add the second part of the script on every page where the widgets you’d like to track are installed.

  1. As long as you use the same layout, this code is basically universal so you should be able to use it for every Audio Player widget on different pages on the same domain. Or you can use it on a different domain as well if needed.

  2. In order to add the code to the website, you do not need to use Google Analytics or Google Tag Manager. With this custom code, all you need to do is add the first part to your website’s theme (to the ) and add the second part on the page where the widget is installed. Everything should work after that.

If you have any other questions, our support agent will be happy to help you!

Hi @Max, thanks for this. The code that was sent had an error in it but Irene is trying to resolve the situation with your developers.

Is there any chance Elfsight will enable users to measure plays (rather than/ as well as ‘views’) from the Elfsight dashboard at some point soon, without having to go through this manual code generation process? To me it seems crazy to provide an audio player without this function!