Tracking mp3 file plays on Marketo Landing Page | Community
Skip to main content
Sarah_McConnell
Level 2
May 1, 2019
Solved

Tracking mp3 file plays on Marketo Landing Page

  • May 1, 2019
  • 1 reply
  • 5628 views

Hi all,

I have an mp3 podcast file embedded on my landing page using an audio script:

audio controls>

<source src="https://go.synack.com/rs/738-OEX-476/images/Synack Podcast - Executive Lunch - RSA 2019 - Episode 1 with Intro.mp3" type="audio/mpeg">

Your browser does not support the audio element.

</audio>

I thought I would be able to track when someone plays the podcast using a link click (tracking the mp3 link) but that doesn't work. Does anyone know of anyway to track if someone clicks play on that mp3 file?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Ok I did this, and still, no one on that list has an activity log that involves a link click, only the web page visit.

Clicked into all these, and none have a "clicklink" activity. So odd.


OK, please try this:

document.querySelector("audio").addEventListener("play",function(e){

Munchkin.munchkinFunction("clickLink",{

href : this.currentSrc || this.src

});

});

P.S. It's actually better to use synthetic Visit Web Page, not Click Link, for reasons I'll explain in an upcoming blog post, but Click Link will be okay for your case.)

1 reply

SanfordWhiteman
Level 10
May 1, 2019

I have an mp3 podcast file embedded on my landing page using an audio script:

<audio> tag actually, not a script. There's no JS in your example.

In fact you need this JS:

document.querySelector("audio").addEventListener("play",function(e){

Munchkin.munchkinFunction("clickLink",{

href : this.src

});

});

Sarah_McConnell
Level 2
May 1, 2019

Thanks for the response, I am still new to this! So the proper way to have this set up would be:

  1. document.querySelector("audio").addEventListener("play",function(e){
  2. Munchkin.munchkinFunction("clickLink",{
  3. href : go.synack.com/rs/738-OEX-476/images/Synack Podcast - Executive Lunch - RSA 2019 - Episode 1 with Intro.mp3
  4. });
  5. });

?

SanfordWhiteman
Level 10
May 1, 2019

Er, no... use the exact code I provided (wrapped in a <script> of course).