A script that hides future offers by reading the visitor's own clock shows them to anyone who changes it. Have the server publish each offer on its own date, and test the whole month before December 1.

Asked for a week early

In the second week of December, a customer at the till asks for a discount from the shop's daily offers page. It is not due until next Thursday, yet she has it on her phone.

By the weekend, three more people have asked for deals that are days away. One explains that her son changed the date on the family computer, and the whole month appeared.

Daily offers exist to bring people back each day. A page that shows the whole plan undoes that, and leaves staff deciding at the counter whether to honour offers that have not started.

Where the hiding happens

Many daily offer pages, including those drawn as an advent calendar, arrive in the browser complete. Every offer for the month is in the page from December 1.

A short script then reads the date from the visitor's own computer and hides every offer whose day has not yet come.

The server's part ends once the page is sent. What shows and what stays hidden then depends on a clock the visitor controls.

How the offers leak

Once every offer is in the page, there are several ways to see them early, and most need no skill:

The first two spread fastest. One customer who learns them tells others at the counter, and soon the trick is in comments on the shop's Facebook Page.

Let the server decide

The fix is to keep future offers off the visitor's computer altogether. The server checks its own date and builds each page with only the offers whose day has arrived.

A visitor who changes a clock, reads the source or turns off scripts then sees nothing extra, because nothing extra was sent.

Most publishing systems handle this with scheduled posts: each offer is written ahead and set to publish at a chosen hour on its day, and stays out of the site and its feeds until then.

The clock on the server

That raises one question: whose time the server keeps. Many hosting servers run on Eastern time or universal time rather than Pacific time.

On such a server, an offer set for midnight can appear at 9 p.m. the evening before, or even at 4 p.m., and the surprise is spoiled again.

Set the site's time zone to Vancouver in its settings, and check a scheduled test post against a clock. Releasing offers at opening time rather than midnight also puts staff on hand.

Pictures, copies and caches

Pictures need the same care. An image uploaded in November as day-14.jpg sits on the server, where anyone who guesses the pattern can open it.

Upload each picture with its offer, or give it a name no customer could guess. The same goes for a printable coupon.

Caching works the other way. A copy of the page saved just before midnight can keep showing yesterday's offer, so set the cache to refresh when offers change.

A worked example

In Courtenay, a bulk food store runs a holiday baking promotion each December, with one item discounted each day on its website: dried cranberries, then pecans, then chocolate chips.

Last year the page was a calendar of 24 doors, each opened by a script. By the second week, regulars were asking for the walnut price due on the 20th.

One customer showed the manager how: she had set her laptop's date ahead to plan her baking. Two others had read the offers in the page source after hearing about it in the store.

For this December, each offer is a scheduled post, written now and set to publish at 7 a.m. Pacific time on its day. Doors for later days are drawn shut, with nothing behind them.

The walnut offer reaches no browser before the 20th, so a changed clock or a look at the source turns up nothing. Whatever customers ask at the till, the site that morning holds the answer.

Testing before December 1

Test the whole month before the first offer. December 1 falls on a Saturday this year, when fewer people are around to fix a problem.

On a test copy of the site, or with a sample post scheduled a few minutes ahead, check that the right offer appears at the right hour, and nothing from later days.

Then try what customers will try: change your computer's date, view the source, turn scripts off, open the page on a phone. Nothing should appear ahead of time.

A rule for early requests

Decide before December what staff say when someone asks for an offer early. Honouring it is friendly; declining is fair when the page says each offer applies only on its day.

Put that rule beside the calendar in a sentence or two, and make sure everyone at the till has read it.

The counter-case

Some shops publish the whole month on purpose. A flyer listing every offer lets customers plan their visits, and a web page that matches it has nothing to hide.

For those shops, doors that open by script are decoration, and a customer who peeks does no harm.

Where the surprise matters, the hiding has to happen on the server. A script in the browser can make a page look locked; it cannot keep anything back.

Ready for the first door

  1. Open the offers page and view its source.
  2. Change your computer's date and reload the page.
  3. Move each future offer into a scheduled post.
  4. Set the site's time zone to Pacific time.
  5. Upload each picture with its offer, under a name that is hard to guess.
  6. Test a sample day on a copy of the site.
  7. Agree what staff say about early requests.

Step three closes the gap. The other steps tidy the edges, but only an offer that has not been sent stays hidden whatever the visitor does.

Testing a site's dates before the calendar reaches them was also the advice in date checks that have never met a February 29.


Frequently asked questions

Why can customers see daily offers before their day?

The page already contains every offer, and a script in the browser hides the later ones using the visitor's own clock. Changing that clock, or reading the source, reveals them.

Is viewing a page's source a kind of hacking?

No. Every desktop browser can show the code behind any page from a menu. Anything sent to a visitor's browser should be treated as something the visitor can read.

What does releasing an offer from the server mean?

The server checks its own date before building the page and includes only offers whose day has come. Future offers are not in the page, so nothing can reveal them.

Why does the server's time zone matter?

Many servers keep Eastern or universal time. Unless the site's time zone is set to Pacific, an offer meant for midnight here can appear at 9 p.m. or 4 p.m. the day before.

Do visitors in other provinces see offers at different times?

With a browser script, yes: each visitor's own clock decides, so someone in Alberta sees each offer an hour early. Released from the server, every offer appears for everyone at once.

When should a daily offers page be tested?

Before the first offer goes live, on a test copy or with a sample post. December 1 is a Saturday this year, so finish testing in the week before.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Offers page built on a browser script?

Give us the page's address, and we will check what it gives away and move each offer to a scheduled release.

Start a Conversation