To support the upcoming Marketo Form Prefill Upgrade, this script automatically appends the mkt_tok from the URL to all your iframe forms.
This solution applies to the “custom implementation” described in the article as required in order to support the scenario of Navigating to a non-Marketo page that includes an <iframe> pointing to a Marketo Landing Page that includes a form with pre-fill enabled.
By using this script – the mkt_tok value from the original HTTP request will automatically pass along to the <iframe> URL, and the form within the Marketo Landing Page will be loaded in the <iframe> and prefill.
WordPress users: Download our free Genius Marketo Form Prefill instead of using the code below.
Insert the script as the last element on the page, right before the </body> tag.
In Google Tag Manager set the trigger to be ‘Dom Ready’.