Set Landing Pages to Expire | Community
Skip to main content
June 15, 2016
Solved

Set Landing Pages to Expire

  • June 15, 2016
  • 5 replies
  • 8617 views

Hi everyone,

Is there a way to have a landing page expire after a certain period of time? For example say for a webinar registration page, after the webinar date the page would direct to a "this event has occurred" kind of message? Or would this be a manual process of going back and editing the page after the event has happened?

Looking forward to everyone's thoughts!

Thanks!

Alec

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

Search the Community as this has been answered before. Basically, there is no ​true​ expiry but you can add a standard JS snippet to every page that, together with a {{my.token}} storing the expiration date, can redirect people to a "Thanks... for trying" page/popup/etc.

5 replies

New Participant
May 17, 2021

Hi Alec,

 

Marketo Sky (MS) has an 'Expiration' feature that allows you to set an expiration date for Landing pages & Smart campaigns. 

 

In MS go the the program containing the landing page, navigate to assets where you should see an option for Expiration. Now select the asset and there is a button on the far right 'Set expiration' which allows setting an expiration date and time.

 

Try it out  😀.

-Manish

SanfordWhiteman
New Participant
May 17, 2021

Hi Manish,

 

Marketo Sky (MS) has an 'Expiration' feature that allows you to set an expiration date for Landing pages & Smart campaigns. 

That feature doesn't meet the requirements in this case.

Robb_Barrett
New Participant
June 16, 2016

Sanford posts "Do a search" and gets marked correct.  I post a fiddle and get no love.

The system is rigged.

Robb Barrett
SanfordWhiteman
New Participant
June 16, 2016

Sorry man. @Joe Reitz​ you can switch the Correct to Robb.  (Though in fairness I posted code, too, if you search. )

Robb_Barrett
New Participant
June 16, 2016

I was one "Correct" away from Blogging Rights, but it looks like I got it somehow anyway.

Robb Barrett
Robb_Barrett
New Participant
June 15, 2016
Robb Barrett
Robb_Barrett
New Participant
June 15, 2016

I'll take Sanford's reply a step further.

In your page template, put in this:

<script type="text/html" id="livepage-html">{{my.Live-Page}}</script>

<script type="text/html" id="expiredpage-html">{{my.Expired-Page}}</script>

Then....

<body>

<div id="body-stuff"></div>

</body>

<script>

if (new Date() > new Date('{{my.expiration-date}}')) {

document.getElementById('body-stuff').innerHTML = document.getElementById('expiredpage-html').innerHTML;

} else {

document.getElementById('body-stuff').innerHTML = document.getElementById('livepage-html').innerHTML;

}

</script>

Then, obviously, in your program put in the following tokens:

expiration-date (type DATE)

Live-Page (type RICH TEXT)

Expired-Page (type RICH TEXT)

Here's an example:

Make an expiration page - JSFiddle

Robb Barrett
SanfordWhiteman
New Participant
June 15, 2016

... but if both HTML variants are going to be pulled into the DOM no matter what, why contain them in <SCRIPT> tags as you would arbitrary non-HTML data? 

It'll be slower to use innerHTML, which causes a reflow and reparse, than to use a hidden parent element and simply move its children under the visible node.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
June 15, 2016

Search the Community as this has been answered before. Basically, there is no ​true​ expiry but you can add a standard JS snippet to every page that, together with a {{my.token}} storing the expiration date, can redirect people to a "Thanks... for trying" page/popup/etc.