Skip to main content
Jul 26, 2017 9:54 PM UTC
Solved

LP cname upon form submission

We have utilized different landing page cnames across domains.  One challenge we have not solved is how to insure the cname remains consistent upon a form submission or clicked link.  If a user arrives at pages.domain2.com/landingpage and submits a form, we would like them to arrive at pages.domain2.com/thankyou.  Currently upon form submission or followed link, the unique landing page cname reverts back to the primary.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

7 replies

Adam_Dost2
Level 2
Jul 27, 2017 2:12 PM UTC

Thank you Sandy!

Translate
SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
Jul 27, 2017 6:11 AM UTC
Cayce_Armstrong
Level 4
Aug 29, 2019 3:51 PM UTC

Hi @Sanford Whiteman‌ - I came across this community post and your linked blog post because we are just starting to use Marketo Landing Pages and are running into this same issue with our Thank You pages. I know nothing about JS and know this is probably a dumb question, but where do you add the script you provided in order to get this code to execute?

Translate
Cayce Armstrong
SanfordWhiteman
Level 10
Aug 29, 2019 3:55 PM UTC

Just inside the closing </body> tag.

Translate
SanfordWhiteman
Level 10
Jul 26, 2017 11:07 PM UTC

MktoForms2.whenReady(function(form){

    form.onSuccess(function(vals,tyURL){

        var loc = document.createElement('a');

        loc.href = tyURL;

        loc.hostname = document.location.hostname;

        document.location.href = loc.href;

        return false;

    })

})

Translate
Adam_Dost2
Level 2
Aug 2, 2017 9:08 PM UTC

For someone who is not technical, where would this code be placed?

Translate