Search
Clear search
Close search
Google apps
Main menu

Use an order ID to minimize duplicate conversions

Add an order ID to your conversion tracking tag to help avoid counting duplicate conversions.

If you add your conversion tag to a conversion page, such as an order confirmation page, then a conversion should only be counted when a customer has completed a valuable action on your website. However, if a customer returns to the conversion page or reloads the page, it’s possible that the same tag could fire again, and a second conversion could be counted for the same order.

To avoid these duplicate conversions, you can edit your conversion tag to capture a unique order ID, such as an order confirmation number you may already be using. If there are two conversions for the same conversion action with the same order ID, AdWords will know the second conversion is a duplicate, and it won’t be counted.

In this article, we’ll explain how to add a unique order ID to your conversion tracking tag.

Before you begin

Before you can add order IDs to your conversion tracking tag, you’ll need the following:

  • Conversion tracking set up for your website. To follow the instructions below, you’ll need to have created a conversion action in your AdWords account and added the conversion tag to your website.
  • Unique order IDs, such as order confirmation numbers for your transactions. The order IDs can include numbers, letters, and special characters like dashes or spaces, with a character limit of 64 characters. They must be unique for each order. The order IDs must not include any information that could be used to identify individual customers.
  • Ability to edit code on your website. Either you or your webmaster will need to edit the conversion tracking tag.

Instructions

You’ll need to add a piece of code to your conversion tracking tag to pull the unique order number and send along in your tag. You don’t need to update anything in your AdWords account: just update your tag.

Keep in mind

  • Make sure you’re passing a dynamic value for the order ID. If your tag sends AdWords the same ID for different transactions, you could significantly undercount your conversions.
  • The instructions below use Active Server Pages (ASP) as an example. The exact code will vary depending on the server language you use. Make sure to use the right language for your website.

Choose the AdWords experience you're using. Learn more

  1. Open the ASP file for your conversion page. (Or, if you use a different server language, open the appropriate file.) If multiple pages are generated from the same file, find the section in the ASP file that generates your conversion page.
  2. If your site has a variable order id, find the ASP expression which stores that information. For example: <%= orderId %>.
  3. Open the HTML for your conversion page, and find your AdWords conversion tracking tag. (You can also make these changes to your conversion tracking tag before adding it to your conversion page. Edit the tag according to the instructions below, and then install the tag according to the instructions in Add a conversion tracking tag to your website.) 
  4. In the script section of the tag (between the <script></script> tags), add the following code, replacing <%= orderId %> with the ASP expression you found in step 2:

    if (<%= orderId %>) {
    var google_conversion_order_id = "<%= orderId %>";
    }
     
  5. In the noscript section of the tag (between the <noscript></noscript> tags), add the following code to the src URL, replacing <%= orderId %> with the ASP expression you found in step 2:

    &amp;oid=<%= orderId %>
  6. To test the code, visit your conversion page by completing a conversion on your site.
  7. In your web browser, view the source of the webpage. (In most browsers, you can do this by right-clicking the page and selecting View source). You should see the conversion tracking code between the <body> and </body> tags on your page. The ASP expression will be replaced by the actual order ID.

 Below is an example of a conversion tag with the order ID code highlighted:

<body>
    ...
    <!-- Google Code for Purchase Conversion Page -->
    <script type="text/javascript">
    /* <![CDATA[ */
    var google_conversion_id = 1234567890;
    var google_conversion_label = "xxx-XXx1xXXX123X1xX";
     if (<%= orderId %>) {
         var google_conversion_order_id = "<%= orderId %>";
    }

    /* ]]> */
    </script>
    <script type="text/javascript" 
    src="//www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
    <img height=1 width=1 border=0 
    src="//www.googleadservices.com/pagead/conversion/1234567890/
    ?label=xxx-XXx1xXXX123X1xX&amp;guid=ON&amp;oid=<%= orderId %>&amp;script=0">
    </noscript>
    </body>

About Order ID and the "Count" setting

Adding an order ID to your tag is not the same as changing your “Count” setting to count one conversion per ad click.

By adding an order ID, you avoid counting the same conversion twice, such as when someone re-opens a purchase confirmation page and one purchase would be counted as 2 conversions.

When you change your “Count” setting to one, you count only one conversion after an ad click, even if multiple conversions, such as multiple different purchases, resulted from the ad click.

So when should you use “Count” versus Order ID? 

  • If you want to track one lead per ad click, change your count setting to “One.”
  • If you want to track every purchase a customer makes after an ad click, but want to make sure you don’t count the same purchase twice, add an order ID to your tag. Adding an order ID is the recommended option for purchases.

Note

  • Order IDs won't be reported in AdWords.
  • Adding an order ID to your tag will not resolve duplicate view-through conversions.
  • If your website already has a solution for removing duplicate conversions, we recommend adding the order ID as an additional tool to ensure your conversion data is as accurate as possible. 
  • If you use Google Tag Manager, you can use order IDs. Make sure to enter the order ID as a variable, not a static string.
Was this article helpful?
How can we improve it?
Previous New
Sign in to AdWords

Get account-specific help and tips by signing in with your AdWords account email address, or learn how to get started with AdWords.