Articles on: Sharing

How can I pass URL parameters into an embedded video for tracking?

You can use the following script to pass URL parameters from the parent page into an embedded video:

<script>
      setTimeout(()=> {
      var params = window.location.search.replace("?","")
      if (params.length) {
        frames = document.getElementsByTagName("iframe");
        for (i = 0; i < frames.length; ++i) {
          if (frames[i].src.includes("stamp") || frames[i].src.includes("interact")) {
            var url = frames[i].src + (frames[i].src.includes("?") ? "&"+params : "?"+params)
            frames[i].src = url    
          }
        }
      }
    }, 10)
</script>

Updated on: 13/05/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!