SOLVED

LP cname upon form submission

Go to solution
Anonymous
Not applicable

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.

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator
7 REPLIES 7
Highlighted
Level 10 - Community Moderator

Re: LP cname upon form submission

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;

    })

})

Highlighted
Level 1

Re: LP cname upon form submission

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

Highlighted
Level 10 - Community Moderator
Highlighted

Re: LP cname upon form submission

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?

Cayce Armstrong
Highlighted
Level 10 - Community Moderator

Re: LP cname upon form submission

Just inside the closing </body> tag.

Highlighted

Re: LP cname upon form submission

Thanks so much for the quick response! I just gave it a try and it worked

Cayce Armstrong
Highlighted
Level 1

Re: LP cname upon form submission

Thank you Sandy!