Google Ads: Dynamic Retargeting for Automotive Dealers (with Google Tag Manager)

There are eight steps to setting up a dynamic retargeting campaign in Google Ads.

  1. Create an inventory feed
  2. Upload your feed to Google Ads
  3. Schedule automatic updates
  4. Create an audience
  5. Get the remarketing tag
  6. Tag your website using Google Tag Manager
  7. Create a dynamic remarketing campaign
  8. Create a responsive ad

Step 1: Create an inventory feed

The first thing you’re gonna need is an inventory feed. Your feed will need to be in .csv, .tsv, .xls, or xlsx format using UTF-8. In order for Google Ads to update your feed regularly (and automatically), you’re going to want this feed to be accessible via the Web.

Google identifies various business types (e.g. education, flights, hotels, etc.). Each business type has specific feed requirements. As an automotive dealer you’ll use the Custom feed type.

Each row in your feed will correspond to one vehicle. And each column will list attributes of the vehicle, e.g. VIN, VDP URL, image URL, etc.

Download the feed template

Here’s the full list of available fields for vehicles.

AttributeNotesSample valuesCan be displayed in ad
IDRequired. I recommend setting this to the VIN.1HGBH41JXMN109186
ID2Optional. If you use VIN for ID, your ID will be unique. So, adding ID2 isn’t necessary. However, ID2 can come in handy for showing related vehicles. If you use ID2, try setting ID2 to the vehicle model.

Important: When using ID2, the unique ID effectively becomes ID+ID2. And if you use ID2, the corresponding info on your website must sent through the remarketing tag, and the values must match exactly. For example, if the value of ID2 in your feed is “Corolla”, the value you send through the remarketing tag must also be exactly “Corolla”.
Corolla
Item titleRequired. Limited to 25 characters. I’d recommend filling this with Year Make Model. And if you can get the trim in there and still remain under 25 characters, go for it.2010 Toyota Corolla S
Final URLEffectively required. Use this field to supply the URL of the VDP.https://davidmeindl.com/vehicle/1HGBH41JXMN109186
Image URLEffectively required. Use this field to supply the URL of the image of the vehicle. PNG is recommended. Google recommends 300 px x 300 px and 72 dpi. 11.4MB and 6 million pixels maximum.https://davidmeindl.com/img/1HGBH41JXMN109186.jpg
Item subtitleRecommended. Limited to 25 characters. Use this field to supply a little more info about the vehicle such as a selling point.Saves money on gas
Item descriptionHighly recommended. Limited to 25 characters. Use this field to supply a little more info about the vehicle such as a selling point.Barcelona red exterior
Item categoryRecommended. Use this field to specify, for example, the vehicle body type. Google uses the item category to group like items together for their recommendation engine.Sedan
PriceHighly recommended. The price must start with the numeric value (i.e. no dollar signs or anything). You can optionally use a comma as a thousands separator. You don’t have to include cents (i.e. decimals). But if you do, you must use the period (.) as the decimal separator. Price must specify the currency. So, after the numeric value, you’ll have a space followed by the three-character code. In the U.S. that code is “USD”.10,000 USD
Sale priceOptional. Sale price is optional. If you do supply sale prices, only do so in those cases where sale price is less than what you’ve supplied for the “Price” attribute.

When a sale price is supplied, the value of the “Price” attribute will be shown with a strike-through, e.g. $10,000 $8,000
8,000 USD
Formatted priceNot recommended. Because vehicle prices can change rather frequently, I don’t recommend using the Formatted price attribute.
Formatted sale priceNot recommended. Because vehicle prices can change rather frequently, I don’t recommend using the Formatted price attribute.
Contextual keywordsRecommended. Use semicolons to separate multiple keywords. You could include keywords like: year make model; make model; condition make model; body style

Google Ads uses this field as a contextual signal in their recommendation engine.
2010 toyota corolla; toyota corolla; used toyota corolla; sedan
Item addressRecommended. Google Ads uses the proximity to the user as a secondary relevance signal.

I recommend using either the physical address of the dealership or the latitude-longitude. If using the address, use the format “street, city, state zip”. If using lat-long, use the DDD.DDDDD format (e.g. “41.40338, 2.12403”).
123 Grand Ave, Des Moines, IA 50309
Tracking templateOptional.Typically, when used, tracking parameters will be applied at the account, campaign, or ad group level. Before using this field, make sure you really need to. You probably don’t.
Custom parameterOptional. Include up to 3 key:value pairs, which are automatically filled up in the click URL. Neither one can exceed 16 characters or 200 bytes. Use semicolons to separate key:value pairs.

Custom parameters could be used to facilitate performance analysis in Google Analytics. For example, you could pass the year, make, and model and then see in Analytics which vehicle models bring in the most traffic from your dynamic remarketing ads.
{_year}=2010;{_make}=Toyota;{_model}=Corolla
Destination URLDo not use. Use Final URL instead.
Final mobile URLOptional. Only use this field if you have a separate mobile-optimized site where the landing page would be different for a mobile user than for someone using a desktop computer
Similar item IDsOptional. This is a comma-separated list of IDs to show together with this vehicle. For example, you might want to display VINs of the same model that have been in inventory longer. 2T1BU4EE3DC096386,2T1BURHE7FC268544 (ID)

Corolla (ID2)
Android app linkUnless your dealership has its own Android app, you won’t want this field.
iOS app linkUnless your dealership has its own iOS mobile app, you won’t want this field.
iOS app store IDUnless your dealership has its own iOS mobile app, you won’t want this field.

See also the Google Ads help center documentation on creating a feed for responsive ads.

Step 2: Upload your feed to Google Ads

Now that you’ve got a feed, the next step is to connect the feed to Google Ads.

First, make sure you’ve got a copy of your inventory feed saved to your computer in the appropriate format (e.g. .csv).

Log in to Google Ads and click on the “tools & settings” icon in the top right corner.

Under the “Setup” section, click “Business data”.

Click the blue “plus” button (+), hover over “Dynamic display ad feed”, then click “Custom”.

Name the feed something like “Dynamic display inventory feed”.

Click the link to select a file from your computer. Locate and select your inventory CSV file.

I recommend previewing the imported feed before applying it. Click “Preview”. Make sure everything looks good. If it’s all good, click “Apply”.

Step 3: Set up an automatic upload schedule

You’ve got static data uploaded into Google Ads. But what we really want is to have Google Ads automatically maintain a current record of our inventory. To do this, we’ll set up a daily schedule for Google to go out to your feed’s URL and pull all your latest inventory data.

Locate and click on the link of your newly created data feed in Google Ads business data section.

In the left-hand navigation menu, click “Schedules”.

Click “+ New Schedule”.

Select the source of your feed.

In this example, I’ve selected HTTPS. So, next we need to paste the URL of your feed. If the URL requires authentication, supply the username and password. Select the frequency, i.e. how often you want your data updated. I recommend every 6 hours. Finally, click “Save”.

Fantastic! You’ve now got a feed that you can connect to a campaign in Google Ads. Now it’s time to set up your website to send visitor data to Google Ads.

Step 4: Create an audience

Google Ads provides a variety of built-in audiences that you can target (after you install the remarketing tag, of course). But we don’t want to target just any old audience. No, we want to target specifically those users who visited either a vehicle details page and optionally a search results page.

Return to the tools & settings menu. Under the “Shared Library”, click “Audience manager”.

This should take you directly to the list of audiences.

Click the blue button to add a new audience and select “Website visitors”.

Name the audience something like “Vehicle Visitors”.

You can just leave the “List members” set the “Visitors of a page”.

In the “Visited page” section, you want to “Match any rule group”. Set the first rule group to “Page URL” > “contains”. Then enter something that uniquely identifies VDP URLs, e.g. “/VDP/”.

If you also want to target people who’ve visited search results pages, click the “OR” button to add another rule group. Define a rule to match SRPs, e.g. “Page URL” > “contains” > “/inventory”.

Step 5: Get the remarketing tag

As I’m sure you know, remarketing works by tracking visitors to your website. That website visitor data is shared with Google Ads. Using that visitor data, Google Ads can show ads to those visitors wherever they go across the Web.

Google Ads provides you with a piece of code to place on every page of your website. Let’s go get that code and install it.

In the left-hand navigation, click “Audience sources”.

Locate the Google Ads tag section and click “Set up tag”.

Select the option to collect data on specific actions people perform on your website to show personalized ads. Then check the box next to “Custom”. Lastly, click “Save and continue”.

At this point you’re asked to choose how you want to install the Google Ads tag. You have three choices:

  • Install the tag yourself
  • Email the tag
  • Use Google Tag Manager

Install the tag yourself

You might choose to use this option if you are able to manipulate the server-side code and don’t use Google Tag Manager or prefer not to set up the remarketing tag through Tag Manager.

After selecting the option to install the tag yourself, Google provides you with two scripts: a global site tag, and an event snippet. Copy the global site tag and paste it in between the <head></head> tags of every page of your website.

<!-- Global site tag (gtag.js) - Google Ads: 987654321 -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-987654321"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'AW-987654321');
</script>

The event snippet is what transforms your remarketing from static to dynamic. It sends the ID (or IDs) (e.g. VINs) that people view to Google Ads so that those people and the vehicles they’ve viewed can be matched up with vehicles from your inventory feed.

Add the event snippet in between the <head></head> tags of your VDPs, immediately below your global site tag.

<script>
  gtag('event', 'page_view', {
    'send_to': 'AW-987654321',
    'value': 'replace with value',
    'items': [{
      'id': 'replace with value',
      'location_id': 'replace with value',
      'google_business_vertical': 'custom'
    }]
  });
</script>

Note that your tags will have a different AW- ID.

In your event snippet, you’ll notice several parameters that will need to have the value inserted dynamically.

On VDPs, set the ‘value’ parameter to the price of the vehicle. This corresponds to the “Price” field in your inventory feed. ‘Value’ must be a numeric value only, e.g. “10000”.

Set the ‘id’ parameter to the VIN of the vehicle. This corresponds to the “ID” field in your inventory feed.

Important: Only include the ‘location_id’ parameter if you’ve included the optional “ID2” field in your inventory feed. If you haven’t included the “ID2” field in your feed, remove the ‘location_id’ parameter from your even snippet. If, on the other hand, you have used the “ID2” field in your feed, then you must use the ‘location_id’ parameter, and the value of the parameter must match exactly the value of “ID2” in your feed.

Finally, leave the ‘google_business_vertical’ set to ‘custom’.

Here’s an example:

<script>
  gtag('event', 'page_view', {
    'send_to': 'AW-987654321',
    'value': '10000',
    'items': [{
      'id': '1HGBH41JXMN109186',
      'location_id': 'Corolla',
      'google_business_vertical': 'custom'
    }]
  });
</script>

Email the tag

Use this option if you’d like to have someone else install the tag. It’s pretty self-explanatory. Google Ads will send an email with instructions to the email you specify.

Use Google Tag Manager

For the remainder of this guide, we’re going to focus on using Tag Manager to send our dynamic remarketing data to Google Ads.

When you select this option, Google Ads provides you with the account’s “conversion ID”. This is the same ID that is used for all conversions within the account.

Copy this ID.

Next we’re going to set up Google Tag Manager for dynamic remarketing.

Step 6: Tag your website using Google Tag Manager

Create variables

The first step in tagging your website is to set up some variables to collect and store information from the website that will be sent to Google Ads. We’re going to create the following.

  • A variable to store the Google Ads conversion ID
  • A variable to identify page types
  • A variable to retrieve the VIN from VDPs
  • A variable to store items from search results pages (SRP)
  • A variable to store the CSS selector of VINs on SRPs
  • a variable to identify the attribute that contains the VINs on SRPs
  • a custom event variable to signal when all the data is ready to be sent

Create a variable to store the Google Ads conversion ID

In Google Tag Manager, navigate to “Variables”. Scroll down to the “User-Defined Variables” section and create a new user-defined variable.

Name the variable “Google Ads Conversion ID”. Select the variable type “Constant”. Set the value of the variable to the conversion ID you just copied from Google Ads.

Create a variable to identify page types

Create another user-defined variable. We’ll name the variable “dynxEvent”. Set the variable type to “Regex Table”.

Set the input variable to “{{Page URL}}”.

In the “Input” field, enter a pattern of vehicle detail page (VDP) URLs that uniquely distinguishes them.

For example, suppose you’ve got a VDP that looks something like this:

https://meindlmotors.com/2020-ford-ecosport-se-maj3s2ge6lc361357

The VDP has a slash followed by four numeric digits followed by a hyphen… And then, toward the end you’ve got a 17 digit alphanumeric string (which happens to be the VIN).

So, you could write a regular expression pattern like the following:

\/[0-9]{4}-[-a-z0-9]+-[a-z0-9]{17}

Note: You probably won’t need to write a complex regular expression like we’ve done in this example. Most website platforms have some sort of string in the URL that explicitly says “this is a VDP” or “this is a search results page” (e.g. “/VehicleDetail/” or “/InventorySearch/” or something).

Enter your pattern into the “Input” field in your dynxEvent variable in Tag Manager. Then, in the “Output” field, enter “view_item”.

Now, add another row to your Regex Table variable. Prepare a (regular expression) pattern for your search results page (SRP) and enter the pattern into the “Input” field. Then, in the “Output” field, enter “view_search_results”.

Finally, click the “Advanced Settings” link and deselect the “Full Matches Only” option.

Here’s what we’ve just done (and why). Every time Tag Manager is loaded on the website, it will look at the Page URL. If the Page URL matches one of the patterns in the “Input” fields, it will return the value in the corresponding row of the “Output” field. For example, if a user visits our example VDP…

https://meindlmotors.com/2020-ford-ecosport-se-maj3s2ge6lc361357

Tag Manager will recognize that this URL matches our pattern in the first row of our table. It will then set the value of the dynxEvent variable to “view_item”, which is the value we set in the “Output” field.

If this is still confusing, don’t worry. It’ll start to make sense once we’ve got all the pieces put together and you see it in action.

Create a variable to retrieve the VIN from VDPs

Create a new user-defined variable. Name the variable “dynxId”. Select the variable type “DOM Element”. Choose the selection method “CSS Selector”.

For the “Element Selector”, we need a CSS selector for the element that contains the VIN.

<li class="LiInvVIN">
  <span class="spnUnitValue">1HGBH41JXMN109186</span>
</li>
li.LiInvVIN > span.spnUnitValue

If the VIN is contained in an attribute of the element, enter the name of the attribute in the “Attribute Name” field. Here’s an example.

<li class="LiInvVIN">
  <span class="spnUnitValue" data-vin="1HGBH41JXMN109186"></span>
</li>

In this particular example, the VIN is contained in the “data-vin” attribute. So, we’ll enter “data-vin” in the “Attribute Name” field.

Create a variable to retrieve and store items from search results pages (SRP)

Create a new user-defined variable. Name the variable “dynxItems”. Set the variable type to “Data Layer Variable”. Finally, set the Data Layer Variable Name to “items”.

Create a variable to store the CSS selector of VINs on SRPs

Create a new user-defined variable. Name the variable “dynxItemsQuerySelector”. Set the variable type to “Constant”.

Just as you identified a CSS selector to get the VIN from the VDP, you’ll want to identify a CSS selector to get the VINs from the SRP. Here’s an example.

<div class="hproduct" data-vin="5GAERBKW9LJ138953">
div.hproduct

Create a variable to identify the attribute that contains the VINs on SRPs

Sometimes, the VIN will be the value of the element itself.

<div class="vin">5GAERBKW9LJ138953</div>

Other times, the VIN will be found in an attribute.

<div class="hproduct" data-vin="5GAERBKW9LJ138953">

Create a new user-defined variable. Name the variable “dynxItemsAttribute”. Set the variable type to “Constant”.

If the VIN on your SRPs is found in an attribute, set the value of your “dynxItemsAttribute” variable to the name of the attribute that contains the VINs. Here’s an example.

<div class="hproduct" data-vin="5GAERBKW9LJ138953">

Here, the VIN is contained in the “data-vin” attribute. So, we’ll set the value of our “dynxItemsAttribute” variable to “data-vin”.

If, on the other hand, the VIN is the value of the HTML element itself, set the value of your “dynxItemsAttribute” variable to “undefined”. Here’s an example.

<div class="vin">5GAERBKW9LJ138953</div>

Here, the VIN is the value of the div element. So, we’ll set the value of our “dynxItemsAttribute” variable to “undefined”.

Create a custom event variable to signal when all the data is ready to be sent

This one’s super easy. I promise. Create a new user-defined variable. Name the variable “dynxReady”. Set the variable type to “Custom Event”.

That’s it.

Whew! And that takes care of all the variables we’ll need. Now let’s create a couple triggers.

Create the triggers

Create the DOM Ready trigger

Navigate to “Triggers”. Create a new trigger. Choose the trigger type “DOM Ready”. Click “Save” and name the trigger “DOM Ready”.

Create a custom even trigger

Create a new trigger. Name the trigger “dynxReady”. Choose the trigger type “Custom Event”. Set the event name to “dynxReady”.

Create the tags

Now we’re getting to the good stuff. We’re going to create two tags. The first one will grab the data that Google Ads needs and push it to Tag Manager’s data layer. The second tag will be the Google Ads remarketing tag which will, of course, send all this juicy visitor, VDP, and SRP data up to Google Ads to populate our remarketing audience.

Push dynamic remarketing parameters

The first tag we need to create is a custom HTML tag. Navigate to “Tags”. Click “New”. Name the tag “Push Dynamic Remarketing Params”. Then, select the “Custom HTML” tag type.

Copy the javascript below and paste it into the HTML section of your tag.

<script>
  var itemsQuerySelector = '{{dynxItemsQuerySelector}}';
  var itemsAttribute = '{{dynxItemsAttribute}}';
  var vertical = 'custom';
  
  if (itemsAttribute == 'undefined') {
    itemsAttribute = undefined;
  }
  
  switch ('{{dynxEvent}}') {
    case 'view_item':
      dataLayer.push({
        'event': 'dynxReady',
        'items': [{
          'id': '{{dynxId}}',
          'google_business_vertical': vertical
        }]
      });
      break;
    case 'view_search_results':
      dataLayer.push({
        'event': 'dynxReady',
        'items': getItems(itemsQuerySelector, itemsAttribute, vertical)
      });
      break;
    default:
      break;
  }
  
  function getItems(querySelector, attribute, vertical) {
    var itemId;
    var item;
    var items = [];
    var list = document.querySelectorAll(querySelector);
    for(var i=0; i < list.length; i++) {
      if (typeof attribute != "undefined") {
        itemId = list[i].getAttribute(attribute);
      } else {
        itemId = list[i].innerText;
      }
      item = {
        'id': itemId,
        'google_business_vertical': vertical
      }
      items.push(item);
    }
    return items;
  }
</script>

Set the tag to fire when the DOM Ready trigger.

Configure the Google Ads remarketing tag

Create a new tag. Name the tag “Google Ads Remarketing”. Set the tag type to “Google Ads Remarketing”.

Next to the “Conversion ID” field, click the macro icon, the little icon that looks kind of like a battery.

Select the {{Google Ads Conversion ID}} variable.

Leave the “Conversion Label” field empty.

Check the box to “Send dynamic remarketing event data”.

Next to the event name field, click the macro icon. Select the {{dynxEvent}} variable.

Leave the event value field empty.

From the “Event Items” field, select your {{dynxItems}} variable.

Set the tag to fire on the “dynxReady” trigger.

Publish

Yep. That’s all she wrote for Google Tag manager. (Glad that’s over with!) The only thing left to do now? Click that “Submit” button to publish your newly added dynamic remarketing stuff.

Create a dynamic remarketing campaign

Create a responsive ad

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.