UTM parameters for Embed SDK script | Community
Skip to main content
Answered

UTM parameters for Embed SDK script


Hi there,

Hopefully this question makes sense. Currently I’m using Embed SDK to include Typeform in all pages on the website with this code: 

<script src="//embed.typeform.com/next/embed.js"></script>
<link rel="stylesheet" href="//embed.typeform.com/next/css/slider.css" />
<script>
  const { open, close, toggle, refresh } = window.tf.createSlider('XXXXXXXX')
  document.querySelectorAll("#button-leadform").forEach(btn => btn.onclick = toggle)
</script>

This is the only code I’m using.

But now we are missing some embed code that allows us to dynamically pass through UTM data. How would I go ahead in adding this line of code:

​​​​​​​data-tf-transitive-search-params=“utm_source, utm_medium, utm_campaign, utm_term, utm_content”

Thanks in advance!

Best answer by Scot

Hi @maartin9 ! I think that you need to add this as part of the options for createSlider. It might look like this:
 

window.tf.createSlider('XXXXXXXX', ​​​​​​​
{
transitiveSearchParams: ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content']
})

You can find some of this kind of info over at our Embed SDK library here. 🙂

Let me know if that helps!

View original

Gabi Amaral
Ex–Typefomer
Forum|alt.badge.img+5

Hey @maartin9! Welcome to our Community!

I've talked to our technical team and they told me to send you this video. Hope it helps! 😉


Scot
Typeform
Forum|alt.badge.img+3
  • Typeform
  • July 29, 2022

Hi @maartin9 ! I think that you need to add this as part of the options for createSlider. It might look like this:
 

window.tf.createSlider('XXXXXXXX', ​​​​​​​
{
transitiveSearchParams: ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content']
})

You can find some of this kind of info over at our Embed SDK library here. 🙂

Let me know if that helps!


Gabi Amaral
Ex–Typefomer
Forum|alt.badge.img+5

Hey @maartin9! Were you able to add the correct code after all? Hoping you did! 


Reply