SOLVED

Re: Script for passing the page url on to a Marketo field

Go to solution
Sarin
Level 3

Re: Script for passing the page url on to a Marketo field

Thanks a lot @SanfordWhiteman 🙂

 

One last question, do we need to keep the type of the custom field as a string or will url type field will also work for the same as the value being captured is a url (with query strings)?

 

And sorry about the unformatted text I was not aware 😞

 

 

 

 

 

SanfordWhiteman
Level 10 - Community Moderator

Re: Script for passing the page url on to a Marketo field

You absolutely want String.

 

URL, despite the name, shouldn't be used for full URLs, only protocol + hostname (https://www.example.com).

Sarin
Level 3

Re: Script for passing the page url on to a Marketo field

Thanks a lot @SanfordWhiteman  🙂

 

Just wanted to confirm the placement of the script:

 

The script needs to be added at the template level for Marketo LPs using guided template and not the LP? As this needs to be after the form embed code we can cant place it in head section and as per my understanding in guided template we cant add the script in elements.

SanfordWhiteman
Level 10 - Community Moderator

Re: Script for passing the page url on to a Marketo field


As this needs to be after the form embed code we can cant place it in head section and as per my understanding in guided template we cant add the script in elements.

You can add a script in a mktoEditable element. I typically allocate one element for that purpose, placed just before the closing </body> tag, called Footer JS or similar.