Automatic Landing Page URL Switch

Automatic Landing Page URL Switch

My idea is that Marketo could have a function that would automatically switch a landing page to a different one after a certain date/time. For example, if I am running a webinar and have a landing page that includes a form to sign up, I could go into Marketo and type in the date and time that I would like the old landing page with the form to switch to another landing page. This landing page would not have a form, and would include something like "The webinar has already ended. Please go here..."

Ideas? Suggestions?

16 Comments
SanfordWhiteman
Level 10 - Community Moderator

Already simple to do. Have a program token with the date (you may already have this). Put a tiny JavaScript snippet that redirects if the date has expired.

Anonymous
Not applicable

Do you have the JavaScript snippet?

Mel_Dadoly
Level 4

Hi Hallie,

If you don't want to use JavaScript, you could always add a redirect rule for the page once you're ready to switch them:

Redirect a Landing Page - Marketo Docs - Product Docs

Anonymous
Not applicable

This is great- thank you Mel!

SanfordWhiteman
Level 10 - Community Moderator

<script>

if ( new Date().getTime() > new Date('{{My.WebinarExpires}}').getTime() ) {

  document.location = 'http://landing.example.com/webinar-signup-expired.html';

}

</script>

Text token using this format:

pastedImage_0.png

Grégoire_Miche2
Level 10

I would combine Sanford's JS with another token (Expired LP URL) that would contain the URL of the secondary LP, combined with a variable to activate / deactivate the feature

<meta class="mktoBoolean" id="ChangeLPonExpired" mktoName="Change LP when expired" default="false" true_value="Switch" false_value="do nothing" >

<script>

if (( new Date().getTime() > new Date('{{My.WebinarExpires}}').getTime() ) && (${ChangeLPonExpired} = 'Switch') ) {

  document.location = 'http://{{my.Expired LP URL}}';

}

</script>

With this, the only thing that one has to do is to set the tokens and switch the toggle to make it work.

-Greg

Andy_Varshneya1
Level 9

Any way to have this include the query parameters in the redirect as well?

Grégoire_Miche2
Level 10

Hi Andy,

yes, sure, you need to capture the querystring of the called page and append it to the expired URL

-Greg

SanfordWhiteman
Level 10 - Community Moderator

var currentLoc = document.location, 

    expiredLoc = document.createElement('a');

expiredLoc.href = '{{my.Expired LP URL}}';

expiredLoc.search = currentLoc.search;


document.location.href = expiredLoc.href;

SanfordWhiteman
Level 10 - Community Moderator

(This stupid forum doesn't do syntax highlighting on Ideas.)