SOLVED

Forms 2.0: Relative paths for follow-up URLs recently removed?

Go to solution
Anonymous
Not applicable

Hi all,

This is a function that we use extensively across our pages and it seems to have been removed recently. Some context to our requirement:

Problem

In the landing page editor, if a form follow-up page is set using Follow-up type > Landing Page > ThankYou Page, or Follow-up Type > External URL > Absolute Path URL when the form is used Google Analytics will reset the submitter's session, removing any referral or source/medium information. The session reset may not affect all users, it's a side-effect of the type of cross-domain tracking we've had to use to maintain sessions between Marketo landing pages and our main websites.

Solution

By setting a thank you page with a relative path (Follow-up type > External URL > Relative Path URL) we are able to prevent Google Analytics from restarting a submitter's session. This was possible until not long ago so we are hoping relative paths can be allowed again. Our active pages are all using relative URLs right now, it's only when we try to change them do we receive an error.

Any other ideas on the above problem would also be much appreciated.

Kind Regards,

Maynard

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Do you see this same behavior when using a my.token to store the URL?

View solution in original post

11 REPLIES 11
SanfordWhiteman
Level 10 - Community Moderator

Do you see this same behavior when using a my.token to store the URL?

Anonymous
Not applicable

That's an interesting idea Sanford I'll give it a shot.

SanfordWhiteman
Level 10 - Community Moderator

Let me know.  In any case, there's an easy JS workaround using the Forms 2.0 API.

Anonymous
Not applicable

I tried a dummy token with the default value set to a relative link, all seems to be working fine.

Thank you for the clever solution!

SanfordWhiteman
Level 10 - Community Moderator

Glad it worked! Definitely an unintended regression, I'd think. Maybe broken while fixing the ability to use tokens (which is why I pointed to that to try).

Anonymous
Not applicable

Just an update on this issue.

The 'dummy token trick' works well for our landing pages hosted on Marketo, but unfortunately it doesn't work for embedded forms as tokens cannot be used. Because of this the embedded forms on our sites are still resetting Google Analytics sessions, so a user that fill out a form is recorded as just a single view of the thank you page.

Really hoping Marketo will allow relative paths in future.

SanfordWhiteman
Level 10 - Community Moderator

MktoForms2.whenReady(function(form){

  form.onSuccess(function(vals,tyURL){

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

    loc.href = tyURL;

    document.location.href = loc.pathname + loc.search + loc.hash;

    return false;

  });

});

Prakash_Mohanda
Level 2

Hello Sanford

You seem to really knowledgeable about URL capture and landing pages in general so this might be a very simple question. I am basically trying to create form that is being embedded on a web page called get-started but the form should automatically redirect to a relative 'thank you' page that one level down in the hierarchy 'get-started/thank-you' . How do I setup a redirect to a relative page on the website that this form is located on?

SanfordWhiteman
Level 10 - Community Moderator

the form should automatically redirect to a relative 'thank you' page that one level down in the hierarchy 'get-started/thank-you' .

Answering on your new thread.

Rocky_Patel
Level 1

Hey Sanford,

I need to change the follow up url to relative path depending on a radio button selection.  See code below.

<div class="mktoRadioList mktoHasWidth" style="width: 380px;"><input name="pERContactUsFormType" id="mktoRadio_32448_0" value="Solutions and Product Inquiries" type="radio" class="mktoField"><label for="mktoRadio_32448_0">Solutions and Product Inquiries</label><input name="pERContactUsFormType" id="mktoRadio_32448_1" value="Client Service Requests" type="radio" class="mktoField"><label for="mktoRadio_32448_1">Client Service Requests</label></div>

So when someone selects "Solutions and Product Inquiries" the follow up URL should be /contact/thank-you.

If they select "Client Service Requests" follow up URL should be /contact/cs-thank-you.  

Can something like this be done through JS or through the Marketo form settings options?

SanfordWhiteman
Level 10 - Community Moderator

Can you open a new thread for this, please?  I'll answer there. Also, pls always highlight code using the Advanced Editor's syntax highlighter so it's readable. In this case choose HTML/XML from the dropdown.