Using AdWords Scripts to Create Engaging Ads - Advent Blog - Marketing Reflections - Advent Communication | Advent Communicati Live Support Chat


Marketing Advice & Reflections

Using AdWords Scripts to Create Engaging Ads

Posted by Steve Cameron
Steve Cameron
Steve Cameron is the Director Owner of Advent Communication. With more than 25 years experience he has a deep...
User is currently offline
on Sunday, 09 February 2014 in Google

One of the keys to a successful AdWords campaign is getting your ad noticed in the search results.

There are a number of ways to do this - its good to include sitelinks and location, call and social extensions, these are all part of the normal campaign set up and if you are not adding these as a matter of course, you should be. but these extensions aside, the ad copy you present is the most important feature of how you bait your hook.

Most blogs will tell you about using triggers - calls to action that induce the click include words such as Now, Today, Rush, Don't Miss, Claim, etc. all designed to encourage the reader to click on your ad.

AdWords scripts add another dimension to the ad copy. By introducing parameters into the ad copy we can make the ad more engaging. Here's a topical example:

We manage the AdWords account for an online florist. As you would imagine, Valentine's Day is an important time of the year - just as Mother's Day will be later in the year - arguably the two biggest days of the year. And those where the online competition becomes fierce. It is in this highly competitive period that we must do even more to attract attention to our ads.

We are using a "countdown" script to add text to our ad copy.

So how do we do this?

We start by adding a new script:












We name the script and then add the code (the full text version is below for you to copy/paste...) we must edit the end date - in this case February 13th - since last orders for Valentine's Day delivery is the 13th - and we add the AD_GROUP_NAME - in this case ValentineDay.











As we can see there are two parameters - time left in days and time left in days. We preview the script to make sure there are no errors being flagged, and then we can return to our ad groups and prepare the ads.

In much the same way as we might build an ad using Dynamic Keyword Insertion, we call the parameters and add some default text just in case the script fails - in this case, without the script, the ad will read:

Valentine's Day Flowers
Only a few days and hours to order!
Use Promo code LOVE for Discount

But with the parameters inserted the ad looks like this:







And it updates itself each hour lending a sense of urgency to the ads. Check that the script is working using the AdPreview Tool in AdWords.

We have seen improvements in CTR's from between 45% and 280% compared with other ads in the ad group.

This kind of countdown script can be used in any number of situations - days till a Sale Starts, or ends, shopping days till Christmas, early bird discount period, pre-order specials and on and on... go crazy!

Here is the full script text... enjoy!


// Date to use to find out how many days are remaining.
var END_DATE = new Date('February 13, 2014');
// Change this to the Ad Group you set up with text ads with AdParams.
var AD_GROUP_NAME ='ValentineDay';

function main() {
var timeLeft = calculateTimeLeftUntil(END_DATE);
var adGroup = getAdGroup(AD_GROUP_NAME);
var keywords = adGroup.keywords().get();
while (keywords.hasNext()) {
var keyword =;
// 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 + '"')
if (adGroupIterator.hasNext()) {

0 votes
Trackback URL for this blog entry


No comments made yet. Be the first to submit a comment

Leave your comment

Guest Tuesday, 25 February 2020