SOLVED

Re: Timed based dynamic content

Go to solution
Anonymous
Not applicable

Timed based dynamic content

Has anyone been able to dynamicaly update a landing page based on the time of day? Or is that only something that RTP offers... 
Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Edward_Unthank_
Level 10

Re: Timed based dynamic content

With a bit of JS and CSS, anything is possible!

{{system.Time}} on a landing page writes the time, and {{system.dateTime}} writes the date and time. 

Take the JavaScript and you can do whatever you want with it. Really, if you're already using JS, you might as well just do it all with JS instead of adding more languages in the mix. Just a getTime function would give you the time, and you can add your own if-then statements to change the contents on the landing page. 

With that, you can write to JS variables and then do whatever you want with the functionality. 
<script>var time = '{{system.Time}}';</script>

If you don't want/can't use JavaScript, there's not an easy out-of-the-box way to customize landing page content. I just tried a few workarounds with CSS and didn't see anything that would easily make time-based dynamic content without JavaScript. The closest I can find is if you want to do AM versus PM—you can create an HTML element with a class of {{system.Time}} and it will output AM or PM as a class:

<h1 class="{{system.Time}}">HELLO, WORLD!</h1>

Leads to:

<h1 class="04:11 PM (GMT -0800)">HELLO, WORLD!</h1>

So you could write CSS to either the AM or PM here:
<style>
h1.PM {color:red!important}
h1.AM {color:blue!important}
</style>

That would make the H1 text red in the PM (local time for the user) and blue in the AM (local time for the user).

But that's mostly a parlor trick. You're probably looking at JavaScript if you want to do anything more advanced than that.

Best,

Edward Unthank | Founder, Etumos

View solution in original post

3 REPLIES 3
Edward_Unthank_
Level 10

Re: Timed based dynamic content

With a bit of JS and CSS, anything is possible!

{{system.Time}} on a landing page writes the time, and {{system.dateTime}} writes the date and time. 

Take the JavaScript and you can do whatever you want with it. Really, if you're already using JS, you might as well just do it all with JS instead of adding more languages in the mix. Just a getTime function would give you the time, and you can add your own if-then statements to change the contents on the landing page. 

With that, you can write to JS variables and then do whatever you want with the functionality. 
<script>var time = '{{system.Time}}';</script>

If you don't want/can't use JavaScript, there's not an easy out-of-the-box way to customize landing page content. I just tried a few workarounds with CSS and didn't see anything that would easily make time-based dynamic content without JavaScript. The closest I can find is if you want to do AM versus PM—you can create an HTML element with a class of {{system.Time}} and it will output AM or PM as a class:

<h1 class="{{system.Time}}">HELLO, WORLD!</h1>

Leads to:

<h1 class="04:11 PM (GMT -0800)">HELLO, WORLD!</h1>

So you could write CSS to either the AM or PM here:
<style>
h1.PM {color:red!important}
h1.AM {color:blue!important}
</style>

That would make the H1 text red in the PM (local time for the user) and blue in the AM (local time for the user).

But that's mostly a parlor trick. You're probably looking at JavaScript if you want to do anything more advanced than that.

Best,

Edward Unthank | Founder, Etumos

SanfordWhiteman
Level 10 - Community Moderator

Re: Timed based dynamic content

I like your parlor trick, man.  To get even more tricky:

H1[class^="04"].PM {
/* rules for 4:00 - 4:59pm */
}


H1[class^="03"].AM {
/* rules for 3:00 - 3:59am */
}
 
Josh_Hill13
Level 10 - Champion Alumni

Re: Timed based dynamic content

javascript offers the most flexibility. If you want to force marketo itself to do this, you'll have to drop people into time based segmentations using the system date tokens or time of creation fields. I wrote about this for an entirely different use, but maybe you can make it work.

http://www.marketingrockstarguides.com/time-zone-lead-routing-marketo-1820/