Re: How to create a token for dynamic information on a landing page?

Anonymous
Not applicable

How to create a token for dynamic information on a landing page?

Hi Marketo peeps,

I am creating a universal Thank You landing page to be used across all content download programs. 

I would like this page to include a link to the actual content, which will vary based on the content the user has submitted a form for.

Would using tokens accomplish this?

If so, what is the best way to set up the token (what should I call it, where, etc)?

If not, what is a better approach I should use?

If documents for this exist already, please point me there.

Thanks in advance!

2 REPLIES 2
Grégoire_Miche2
Level 10

Re: How to create a token for dynamic information on a landing page?

Hi Caryne,

You will have to store the content download link in a lead token. Create a custom lead field (text or URL type), and add that field to the form, as a hidden field. Populate that hidden field with a URL parameter or a default value. Then add that field as a token to your follow-up field. if you use a URL parameter, this will have a drawback: the download link will show in the URL (the URL will look like http://page.mydomain.com/landingpage.com?download=page.mydomain.com/mypdfdoc.pdf

I recommend that you do not populate that field with a smart campaign as you would not control the delay of the smart campaign.

An alternative would be to populate the URL field with some javascript.

Also, aside of tokens, you could also pass the download URL to the follow-up page and capture it with some JS to display in the page. This second method has the advantage that the download URL will not appear before the form is filled out.

-Greg

SanfordWhiteman
Level 10 - Community Moderator

Re: How to create a token for dynamic information on a landing page?

I wouldn't say you should use hard-coded lead fields here (Greg's first suggestion).

Rather, his third suggestion (pass the download URL to the Thank You page) seems to me to conform much more to Marketo Forms 2.0 concepts and patterns. Every form has its own follow-up URL, and a form can even choose among multiple URLs (Add Choice) if you choose to use a global form and/or offer different content depending on the value of a form field.

After a form posts, every Marketo Form passes the URL chosen as the follow-up page back to the form's (JavaScript-based) onSuccess handler. So set the follow-up URL in the form settings to the location of the downloadable PDF.  In an HTML block, append the dynamic PDF URL to the static Thank You URL.

On your LPs:

MktoForms2.whenReady(function(form){

     var sharedThankYouURL = 'http://pages.example.com/thankyou.html';

     form.onSuccess(function(vals,pdfURL){

          document.location.href = sharedThankYouURL + '?' + pdfURL;

          return false;

     });

});

On thankyou.html:

<a id="download" href='#'>Download your content</a>

<script>

    document.querySelector('#download').href = document.location.search.substr(1);

</script>

Plenty more customization is possible, but this is the framework to follow.