Ad Exchange remarketing guide

Non-JavaScript remarketing tags

We recommend using the JavaScript version of the tag because it provides the benefits of correct caching behavior and spam detection.

For remarketing lists, Google produces a script tag that includes a <noscript> portion along with an <img> tag. While there are advantages to using the full tag, if you have policies against placing script tags on your webpages, you have the option of using a non-JavaScript tag instead.

Some reasons why you might want to use the <noscript> tag:

  • If you use Floodlight, the <script> tag can use up too much character allotment.
  • You might not want JavaScript running on your pages.

If you do choose to use a non-JavaScript version, then the browser caches the tag and it won't reach the server after the user's first visit to that page. The JavaScript version adds a random number to the tag to avoid caching, ensuring that the cookie's membership in the remarketing list is refreshed with each visit.

If you do decide to use a non-JavaScript version of the remarketing tag:

  1. Generate a tag from the Audiences settings page. For more information, see Creating a new remarketing list.

  2. Remove all code that's highlighted in yellow:

    <!-- Google Code for Lead Conversion Page -->
    <script type="text/javascript">
    <!--
    var google_conversion_id = 111111;
    var google_conversion_language = "en_US";
    var google_conversion_format = "1";
    var google_conversion_color = "ffffff";
    var google_conversion_label = "lead";
    //-->
    </script>
    <script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
    </script>


    <noscript>
    <div style="display:inline;">

    <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/111111/?label=lead&amp;guid=ON&amp;script=0"
    />


    </div>
    </noscript>

    The tag now looks like the following:

    <img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/111111/?label=lead&amp;guid=ON&amp;script=0"
    />

  3. Place it on the page(s) or server(s) from which you want to collect users.

If you simply need a lightweight version of the tag, try something similar to this:

  1. Use a function like the following to generate a random number:

    ord=Math.random();

    ord=ord*10000000000000000000;

  2. Add the random parameter to the tag:

    <script language="JavaScript" type="text/javascript">

    //<![CDATA[

    document.write('<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/pagead/conversion/111111/?label=lead&amp;guid=ON&amp;script=0&random=' + ord + '"');

    document.write('/>');

    //]]>

    </script>