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?
Solved! Go to Solution.
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.)
I am not sure how to see that in Dev Tools....
Look at the Network tab. You'll see hits to ../clickLink.
Just seeing hits to the mp3 file name
OK, I swapped in one of my Munchkin IDs for yours (and fixed the JS syntax error) and audio tracking works as expected.
So if you fix the syntax error on your actual LP there shouldn't be any problem.
I fixed the Syntax error and it still doesn't seem to be working on my end. Would love to hop on a screen share! I am free all day today. Thanks so much for all your help on this!
How about right now? Message me and I'll give you my JoinMe.
Message sent!
Sarah, you still have a syntax error because of an extra comment:
After fixing that (you may want to cut the whole current <script> out, save + approve, and then go back in and re-paste the code) try again.
If it still doesn't work, rather than posting screenshots it's probably better to do a quick screenshare and I'll figure it out. Let me know when you're around.
It shows "Paused in debugger". Do you have a breakpoint set? Nothing will run while paused.