Google AdWords Scripts: Introduction Part 1

To check out my scripts tutorials visit the following link.

It is possible that we are used by now to getting up every week and perform “routine” chores in our account: making a specific report, pause some words, create a new ad group, update campaigns for specific dates, etc.

Now, with the scripts we can end the routine


 Are you trying to buy AdWord Scripts? If you are, click here.


Let’s ge tour own robot to manage the account



In this first introduction, we will be able to take our first steps into the amazing world of scripts, which will take a while to fully understand but if we do things correctly, we will be able to be able to achieve the dream of every account manager and raise our ROI quickly and effectively.


What are these scripts?

Scripts are codes programmed in Javascript that allow us to take information from the internet and from our account and realize automated commands. Given the amount of script examples that we can find online, there is no need for us to become programmers or have a complete understanding of Javascript in order to apply them to our account.(the more knowledge we posses, the more control we can have over the commands we apply and the more advantages we can obtain)

We need to have some knowledge, enough to understand the big picture of what each line does in order to be able to twitch it according to our needs.

There are plenty of online tutorials to learn how to use Javascript, I recommend you to choose from any one of these and dedicate some time to understand the basics of the language.

Is it worth my time to learn all this? 

Even though AdWords recommends the use of scripts for big accounts, knowing the basics can help in any situation, we will find more time to perform optimizations and administer the accounts in an orderly manner.

If you are trying to read this article and obtaining results by tomorrow, then you are in trouble. But if you are thinking with a long term mindset, then you are on the right track.


What can I do with scripts?


Here are some examples of different applications of scripts for your AdWords account.


– Every Monday at 8 am you can have a script that will analyze the performance of the last 7 days segmented in each campaign, transcribe them into a Google document and send it to your e-mail or even better, your client’s e-mail.

– Search for words that have lots of impressions and low quality and label them for you to check.


– Update an ad with the exact numbers that vary with time (“its X hours till Christmas” “Big Sale, X hours left”)

-change the relevante of key Words in different campaigns according to their performance, automatically raising the investment for those specific words.

– analyse the search terms report and add to your account the key words that registered conversions..


And many many more….it all depends on how creative you get.


Im sold. What now?


This week, we will see a great example of how to increase the CPC of the words that are performing really well taking as an example the scripts that Google AdWords provides.

What does “good performance” jeans? Whatever you consider: Good CTR, good position, etc

function main(){
  // Vamos a considerar que una palabra clave tiene una buena performance si
  // su CTR es mayor a 2%, y su nivel de calidad es más alto que 7.
  var keywordsIterator =AdWordsApp.keywords()
      .withCondition("Ctr > 0.02")
      .withCondition("QualityScore > 7")

    var keyword =;
    // Increase the bid by 5%.

Analyzing these line by line:


In order to create a script we have to go into our AdWords account, clic on Masive operations and g oto “scripts” and enter “ create script.

We have to copy the code we just typed and by clicking on preview we can check the changes that the script would apply befote we actually give it a green Light. It is essential to always check before applying a script because there is no way to go back on the changes that are executed once we apply the script.

In order to use the script we have to clic on “authorize script” so it can access our account.



We are ready now to analyze it.


Checking performance


// Vamos a considerar que una palabra clave tiene una buena performance si
  // su CTR es mayor a 2%, y su nivel de calidad es más alto que 7.
  var keywordsIterator =AdWordsApp.keywords()
      .withCondition("Ctr > 0.02")
      .withCondition("QualityScore > 7")

We can always take notes on our scripts to remember how they work and what exactly are they doing. This can be done by simply starting a line with a // double sidebar.


var.keywordsIterator is a variable that will vary each keyword and test them one by one. In order to achieve this we have to set the key words that we want. Here comes the part  were we can personalize the scripts according to our specific needs: each withCondition will tell AdWords that we want a “Ctr >0.02”  We do not need to be programmers to understand this. The values can be changad. I will leave you the anex in which you can find all the data that we can use with its variables.

what do we do with the key words that apply to the script.



    var keyword =;
    // Aumentar la oferta en 5%.

The 2 first lines indicate that as long as there are keywords, changes are applied to the last line of code: keyword.setMaxCpc defines the maximum amount of CPC for each keyword.


This is calculated as the maximum CPC of each keyword multiplied by 1.05, which means, increase the CPC by 5%. These values can be changed according to your desires.


Now, we have our first script! We can click on preview and check the data that has been modified when the script is applied. We can either execute the script of save it for a later use.

If you made it here it means that you are interested in the subject and it is possible that you have a lot of questions. As always, I recommend you to take advantage of the Google AdWords Community to check and answer all the questions you might have so you can begin to fully understand and utilize the potential of the Scripts.

Welcome to a magical World!!.


 Anex Value table

if you want to learn more, go to


AveragePosition Double withCondition(“AveragePosition > 7.5”)
Clicks Long withCondition(“Clicks >= 21”)
ConversionRate Double withCondition(“ConversionRate > 0.1”)
actuales Long withCondition(“Conversions <= 4”)
Cost Double withCondition(“Cost > 4.48”). El valor se devuelve en la moneda de la cuenta.
Ctr Double withCondition(“Ctr > 0.01”). Tenga en cuenta que Ctr se devuelve en el intervalo 0..1, de forma que un Ctr del 5% se representa como 0,05.
Impressions Long withCondition(“Impressions != 0”)
Atributos de palabra clave
Status Enumeration: {ENABLED, PAUSED} withCondition(“Status = PAUSED”)
Texto String withCondition(“Text STARTS_WITH ‘leather'”)
MaxCpc Double withCondition(“MaxCpc > 0.50”). El valor se devuelve en la moneda de la cuenta.
DestinationUrl String withCondition(“DestinationUrl CONTAINS ‘'”)
QualityScore Entero withCondition(“QualityScore >= 6”)
FirstPageCpc Double withCondition(“FirstPageCpc < 1.00”). El valor se devuelve en la moneda de la cuenta.
TopOfPageCpc Double withCondition(“TopOfPageCpc < 3.00”). El valor se devuelve en la moneda de la cuenta.
AdGroupName String withCondition(“CampaignName CONTAINS_IGNORE_CASE ‘shoes'”)
CampaignName String withCondition(“CampaignName CONTAINS_IGNORE_CASE ‘promotion'”)

Try it out now!!

Leave a Reply

Your email address will not be published. Required fields are marked *