How to create ad groups at scale for Google shopping ads?

Google Smart Shopping campaigns are a powerful tool for eshop. It can create ads campaigns directly from the productfeed of the eshop automaticaly. However it is not advised to generate a single campaign for your entire product feed. You might want to create different ad groups for each product category. You might also want to remove products with low prices from your campaign to avoid damaging your ROI.

Creating multiple ad groups manually is a tedious task. Thankfully in this article I will show you how to do it semi-automatically. The process requires 2 steps:

  • Step 1 : will look at your product feed to check what data attribute could be used to segment your ad groups
  • Step 2: will generate an import file for Google Ads to create the ads groups.

The development of this automation was sponsored by Smartlook.

Step 1: Check your product feed for relevant attributes

This step will leverage the python script accessible there. In order To run the script you will need to install Anaconda on your computer.

Setup Anaconda

You can instal anaconda from this link:

Once it is installed: open anaconda prompt as admin

Run the following line:

conda install -c conda-forge pandas

conda install -c anaconda beautifulsoup4

Run the script:

Download the script from here.

Open it using Spyder:

Edit the line 3 with the url of the eshop feed you are working on.

Edit the line 6 with the path under which you wish to save the result. You need to use “\\” instead of the “/” in the access path. Also don’t forget to end the file name with “.xlsx”.

Click the run button on top of Spyder window:

Import the result in google sheet.

As a result of the script you will have an excel file with all the attributes of your product feed and all possible value of each attribute:

You can use this file to decide the most relevant attributes to segment your ad groups, and prepare the google sheet doc for the step 2.

Step 2: Create import file for google ads.

Once you choose which attribute you wish to use for segmentation you can copy paste the column with those attributes in a google sheet file. You can choose between 1 and 3 attributes for the segmentation.

If you wish to use one of the “custom_label” attributes (custom_label_1, custom_label_2…), you need to replace the underscore by space in the name of the variable. For example “custom_label_1” will become “custom label 1”.

Under the tool menu go to script editor:

Copy/paste the code from here into the script editor.

Click on the save button (you can name the project as you wish)

Under the run tab click on “main_adword_script”:

The macro will request access to the google file, grant it.

You will have a new sheet in the google spreadsheet:

You can:

  • Write the campaign name in the first column
  • Add Max CPC for each ad group.

You can then download the spreadsheet and import it into Google Ads.

Growth Hacker consultant