Passing a query string to the thank you page

Mikes_Jones
Level 8

Passing a query string to the thank you page

so we need to track conversions for LinkedIn based on Thank You Page, however we use this specific thank you page for multiple landing pages.

i think the solution here is to pass a querystring to the thank you page so that the URL is unique.

is there a way to get this done via MKTO?

and while on the topic of thank you pages, what is the best practice here? should you have a unique thank you page per landing page, or is it okay to use "master" thank you pages based on channels for example

- thank you PPC

- thank you event

- thank you webinar

- thank you asset download

- thank you main form contact

Tags (1)
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Passing a query string to the thank you page

should you have a unique thank you page per landing page, or is it okay to use "master" thank you pages based on channels for example

Try to have as few Thank You pages as possible. Preferably only one (it can switch based on querystring content). The wild proliferation of Forms and Thank Yous is a primary cause of instances becoming unmanageable.

i think the solution here is to pass a querystring to the thank you page so that the URL is unique.

is there a way to get this done via MKTO?

Of course.

MktoForms2.whenReady(function(form){

  form.onSuccess(function(vals,thankYouURL){

    var thankYouLoc = document.createElement("a"),

        currentLoc = document.location;

    thankYouLoc.href = thankYouURL;

    thankYouLoc.search += "&prev=" + encodeURIComponent(document.location.href);

    document.location = thankYouLoc;

    return false;

  });

});

The original referring page will then be in the prev query parameter.

Bear in mind the referrer (document.referrer) is also automatically available via JS on the Thank You page. Depending on how conversion pixels are loaded they can just read the referrer, no need for it to be echoed in the QS.

Frederick_Weiss
Level 1

Re: Passing a query string to the thank you page

Can you provide an example of how/where to add the code above?

SanfordWhiteman
Level 10 - Community Moderator

Re: Passing a query string to the thank you page

In between <script></script> tags, just inside the closing </body> tag (if on a Marketo LP) or anywhere after the Marketo form embed code (on a non-Marketo LP).