Skip to main content
Jun 15, 2016 7:48 PM UTC
Solved

Set Landing Pages to Expire

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.
SanfordWhiteman
SanfordWhitemanAccepted solution
User Group Leader
Jun 15, 2016 7:55 PM UTC

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.

18 replies

SanfordWhiteman
User Group Leader
SanfordWhitemanUser Group LeaderAccepted solution
User Group Leader
Jun 15, 2016 7:55 PM UTC

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.

Translate
Robb_Barrett
Level 10
Jun 15, 2016 8:08 PM UTC

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

Translate
Robb Barrett
SanfordWhiteman
User Group Leader
User Group Leader
Jun 15, 2016 8:41 PM UTC

... 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.

Translate
Robb_Barrett
Level 10
Jun 15, 2016 9:06 PM UTC

Here you go:

Hidden Divs - JSFiddle

Translate
Robb Barrett
Robb_Barrett
Level 10
Jun 16, 2016 3:41 AM UTC

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

The system is rigged.

Translate
Robb Barrett
SanfordWhiteman
User Group Leader
User Group Leader
Jun 16, 2016 3:47 AM UTC

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

Translate
Robb_Barrett
Level 10
Jun 16, 2016 3:50 AM UTC

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

Translate
Robb Barrett
Level 4
May 17, 2021 11:05 AM UTC

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

Translate
SanfordWhiteman
User Group Leader
User Group Leader
May 17, 2021 5:43 PM UTC

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.

Translate