Practical Ecommerce

Using Google AdWords Countdown Script, for Urgency

One of the most powerful messages in advertising copy involves playing to your consumers’ sense of urgency. This notion is portrayed with terms such as “limited time offer” or “one-day sale,” with the goal of convincing the consumer to shop now instead of later. Many merchants consistently run sales, but the sense-of-urgency messaging is either missing or unconvincing. There is an option in Google AdWords, however, that dynamically populates your text ads with the time left until a sale ends or an event occurs. This feature is AdWords’ countdown script; it involves the use of JavaScript.

Here is an example of the countdown script used in an ad by a company (a client of my employer) selling Mother’s Day cards. The ad refreshes daily to show the consumer how many days are left until the holiday.

Counting down the days until Mother's Day

Counting down the days until Mother’s Day.

Going even further, you can set the script to showcase how many days and hours are left before a particular campaign ends. In this example, the merchant is offering $10 off the Seresto line of products.

Counting down the days until the offer ends.

Counting down the days until the offer ends: “Only 10 Days 10 Hours Left.”

Writing the Ads

Here is how to set up ads using the countdown script. You don’t need programming experience to use this feature. The instructions below give a detailed and easy-to-understand guide for implementing the script.

The first step is to create the ads with dynamic parameters. These parameters represent where days and hours will be dynamically generated. To include both time intervals (days and hours), add your chosen parameters into the following syntax.

{param1:a Few}
{param2:and}

Here is how these parameters will look in the Seresto ad.

Ad with days and hours parameters.

Ad with days and hours parameters,

And since we’re counting only the days until Mother’s Day, we only need to use one parameter.

Ad with just days parameter.

Ad with just days parameter.

You can try different forms of messaging, but to run the script, at least one parameter is needed.

Creating the Script

Once your ads are written, you’re ready to create the script. To get to this area, click “Bulk operations” in the left-hand navigation of the AdWords interface. One of the bulk operations you will see is for scripts. Click the option to “Create and manage scripts” and then click the red “+ Script” button. You’ll then see a screen that will allow you to paste your script.

Setting up the script.

Setting up the script.

Here is where you will create your script. All you have to do is (a) copy the code below, (b) convert it to raw text, and (c) paste into the AdWords interface. The only two items that will need to be updated are the sale end date and the ad group where the ad is located.

Insert date to use to find out how many days are remaining.

var END_DATE = new Date(‘INSERT END DATE HERE’);

Change this to the ad group you set up with text ads with AdParams.

var AD_GROUP_NAME = ‘INSERT AD GROUP NAME HERE’;

function main() {
var timeLeft = calculateTimeLeftUntil(END_DATE);
var adGroup = getAdGroup(AD_GROUP_NAME);
var keywords = adGroup.keywords().get();
while (keywords.hasNext()) {
var keyword = keywords.next();

We want to update {param1} to use our calculated days and {param2} for hours.

keyword.setAdParam(1, timeLeft['days']);
keyword.setAdParam(2, timeLeft['hours']);
}
}

var DAY_IN_MILLISECONDS = 1000*60*60*24;

function calculateTimeLeftUntil(end) {
var current = new Date();
var timeLeft = {};
var daysFloat = (end – current) / (DAY_IN_MILLISECONDS);
timeLeft['days'] = Math.floor(daysFloat);
timeLeft['hours'] = Math.floor(24 * (daysFloat – timeLeft['days']));
return timeLeft;
}

function getAdGroup(name) {
var adGroupIterator = AdWordsApp.adGroups()
.withCondition(‘Name = “‘ + name + ‘”‘)
.withLimit(1)
.get();
if (adGroupIterator.hasNext()) {
return adGroupIterator.next();
}
}

Here is what the final version of the script looks like after adding the end date and ad group name.

Final version of countdown script.

Final version of countdown script.

Before previewing the script, authorize Google to run it. Since this script will be making changes for you, Google requires your permission beforehand. Once permission is given, you can preview the script.

Assuming everything is working right, you should see a screen like the one below. If your countdown script is not working properly, then you will need to troubleshoot. Generally, a syntax error is the most common reason for a script not working. So double-check your script’s adherence to the provided code.

Preview countdown script results

Preview countdown script results.

Once everything is working properly, click the “Run script now” button. To ensure that the script runs hourly, you’ll have to set the appropriate schedule for it to run.

Set the refresh frequency.

Set the refresh frequency.

The script has now been created and will run hourly until the designated date.

Final Thoughts

I’ve found that this script provides the most value as the end date gets closer. This may seem obvious, but it backs up the notion of urgency and the necessity to act. Consumers might not notice that a sale “ends soon,” but the message could resonate when they are presented with the specific amount of time left.

This script also helps text ads stand out against Product Listing Ads. Text ads will always have their place but it’s no secret that PLAs are more eye-catching and profitable. Anything that can be done to enhance the look of text ads has value.

Thinking ahead, with the fourth quarter generally being the most profitable time of the year for merchants, the countdown script could play a huge role. Between Black Friday, Cyber Monday, and the holidays, merchants can create a sense of urgency in shoppers.

Tags:  

Matthew Umbro
Matthew Umbro
Bio  |  RSS Feed


Get the Practical Ecommerce RSS feed

Comments ( 7 )

  1. David Pavlicko May 27, 2014 Reply

    Great script! Thanks for sharing this.

  2. Luke May 27, 2014 Reply

    Super detailed and thorough post! Thanks Matt.

    How much of a difference have you seen in ad performance when using this? I could see the countdown working really well for sales. What about just for Mother’s day? Most people know (or could quickly figure out) how many days are left. Have you seen these really boost performance?

  3. Matthew Umbro May 27, 2014 Reply

    Hi Luke,

    More often than not I see the script improve click-thru-rate (CTR). Depending on the sale and/or days left until an event, conversion rate doesn’t always necessarily increase, but CTR does.

    I will say that I’ve seen improved conversion metrics when emphasizing both the days and hours left until a sale ends. Adding to that statement, conversion rate increases the most when I list the specific sale. Earlier this year I ran an ad like the Seresto example. It included the days and hours left in the sale while speaking to the specific promotion. During the last few days of the sale I was only running this ad because conversion rate was that much better than the field.

    Overall, I’ve seen improved CTR and sometimes better conversion metrics with the countdown script.

  4. shy May 28, 2014 Reply

    I do not understand where my mistake,

    The code returns:

    Script finished with runtime error

    I’m not strong in programming : (

  5. Carlos Rivera May 28, 2014 Reply

    I did not know that this was possible in AdWords! Thank you so much for sharing!

  6. David Rothwell May 28, 2014 Reply

    Very neat Matt – thanks for sharing!

  7. Matthew Umbro May 28, 2014 Reply

    Hi Shy,

    For further clarification I would review this information from Google:

    https://developers.google.com/adwords/scripts/docs/solutions/sale-countdown

    If you go down to the “Source code” section you should see the complete script.

Email Newsletter Signup

Sign up to receive EcommerceNotes,
our acclaimed email newsletter.

And receive a free copy of our ebook
50 Great Ecommerce Ideas