If I’m sending a survey through MailChimp that includes a URL to a page with a survey embedded on it, and I want to pass the user’s email address using a merge tag, will this work? Would I just need to append the merge tag to the end of the page’s URL?
Hi
Hi, it’s actually a different use case than the other thread, so I decided to start a new question.
Does the question make sense? If we’re sending users from MailChimp to our domain that has the survey embedded on it, how do we pass the merge tag data (ie: email address) to the embedded survey?
Hey
For this type of advanced usecase you will need to use our Embed SDK, which gives more control than the code snippets in the share panel.
In the SDK we added a `transferableUrlParameters` parameter that will grab query parameters from the parent window and pass them as hidden fields to the form.
here is the JavaScript snippet you could use
var url = "https://picsoung.typeform.com/to/QXS2h1" // NOTE: Replace with your typeform URL
const embedElement = document.querySelector('.target-dom-node') // NOTE: `.target-dom-node` is the target DOM element from your website or web app
window.typeformEmbed.makeWidget(
embedElement,
url,
{
transferableUrlParameters: r'utm_source', 'username'], //pass automatically from parent window to embedded typeform
onSubmit: function () {
console.log('Typeform successfully submitted')
}
}
)
And on glitch you will find a project with the whole example, easy to fork and remix for your own use.
Hope it helps
Thanks for your help
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.