Quite simple actually. Just takes a little thinking about to get the initial logic. I have wrote you the following script which displays Show Advert every 24 hours. This can be modified as you please by modifying the integer 24 to whatever you please. The date is stored in a cookie and then sent to the server upon every page request. Even if an individual hasn't visited your website for 72 hours, it will still display the advert and then hide it until another 24 hour's time.
Ok, iisbum's script has been working well.
Now I was wondering if there's any way, to show the code on the 2nd pageview?
I don't want my visitors to get hit by it on the first time they see the site, so 2nd pageview would be better, and then for the rest, again, once every 24 hours on the 2nd pageview.
Basically you set the cookie on the first pageview to a control value, say 1, and to expire at the end of the current session, so if the user leaves the site after that first pageview if they comeback later that day they will again see the ad on the 2nd pageview.
If the cookie is set to 1, show the ad and set to another value, with an expiry in 24 hours.
The Following User Says Thank You to iisbum For This Useful Post:
It wasn't a mistake if you read my explanation it was exactly what I intended.
If the user only looks at 1 page in that visit, you want the cookie to expire immediately, so that when they return to the site again later that day or tomorrow, they don't see the ad on their first pageview.
I guess that may not be what Sled wanted, as you say he'd show more ads. That's they way I would code it to maintain the fact that users only see the ad on their 2nd pageview of each visit, but only see the ad once every 24 hours at most.