Use Google Tag Manager to Set up DPA Dot Tags

This guide describes how you can use Google Tag Manager (GTM) to set up and deploy your Yahoo Dot tag. Using GTM, you can create a custom script for your product ads across your webpages.

That said, GTM does not provide support for a Yahoo Dot tag template, which means that you’ll need to perform a custom tag setup, following the steps outlined below.

If you already have an account with GTM and are familiar the GTM UI, you’ll want to take advantage of this tag manager to set up your Dot tags for DPA.

Setup Steps for Google Tag Manager

Follow these steps:

  1. Sign in to GTM and create a new tag by clicking New Tag.

sign in
  1. Provide a name for the tag (for example, Native & Search Dot Tag) and click Choose a tag type to begin setup.

name tag
  1. Search for custom and select Custom HTML.

choose tag
  1. Paste the Native & Search Dot tag generated by Gemini.

A sample Dot tag is included below.

tag config

Note that the projectId (in this case, 10000) and pixelId (10015984) are provided by Native & Search.

<script type="text/javascript">(function(w,d,t,r,u){w[u]=w[u]||[];w[u].push({projectId:"10000",properties:{pixelId:"10015984"}});var s=d.createElement(t);s.src=r;s.async=true;s.onload=s.onreadystatechange=function(){var y,rs=this.readyState,c=w[u];if(rs&&rs!="complete"&&rs!="loaded"){return}try{y=YAHOO.ywa.I13N.fireBeacon;w[u]=[];w[u].push=function(p){y([p])};y(c)}catch(e){}};var scr=d.getElementsByTagName(t)[0],par=scr.parentNode;par.insertBefore(s,scr)})(window,document,"script","https://s.yimg.com/wi/ytc.js","dotq"); </script>
  1. Scroll down and click Choose a trigger to make this tag fire and choose All Pages.

choose trigger
  1. Click Save to save the tag.

  2. Follow steps 2-4 to create another custom HTML tag, but copy-and-paste the DPA custom script.

The double curly braces indicate that ea and product_id are dynamic values that we’ll define later in the Variable section of the Google Tag Manager, like this:

double curly braces

A sample tag name could be DPA Custom Script.

These are the values that will be passed in from the your website.

dot tag script braces
  1. Save the tag without setting up a trigger.

  2. Return to the Native & Search Dot Tag that was set up previously. Follow these mini-steps:

Click the edit icon on the top and click Advanced Settings. Now click Tag Sequencing and click Fire a tag after Native & Search Dot Tag fires and select the DPA Custom Script. Check the Don’t fire DPA Custom Script if Native & Search Dot Tag fails or is paused checkbox.

Finally, click Save to save the tag.

gemini dot tag
  1. Click Variable.

This sets up the ea and product_id variables.

click variables
  1. Click New under User-Defined Variables.

config
  1. Enter ea as the name of the variable and click Choose a variable type to begin setup.

choose variable
  1. There are many ways to define the variable. In this guide, we select Custom Javascript in order to fetch the value with a class.

choose type
  1. In our example website, the ea (for example, AddToCart) is placed between a HTML tag with the class name ea (for example, <span class=’ea’>AddToCart</span>).

The JavaScript code to fetch AddToCart in our example is

document.getElementsByClassName("ea")[0].innerHTML.

For our example snippet, we need to add a function like this:

 function(){
   var a=document.getElementsByClassName("ea")[0].innerHTML;
 return a;
}
custom javascript
  1. Save the variable ea and repeat steps 11-14 for product_id.

  2. To obtain the GTM Tag for your site, go to ADMIN and then click Install Google Tag Manager.

Follow the instructions to apply the tag on to the your site.

  1. When the tag setup is completed, you can test it by pressing Preview or Submit under the WORKSPACE section to launch the tag.

config submit
  1. Under the debug mode (Preview mode), the values ea and product_id should be populated under Variables.

The Dot tag and the DPA custom script can also be confirmed by installing and using the Yahoo Dot Helper Chrome Extension.

dot helper