Notification

Got 5 minutes? Help us with a quick study about the Search Ads 360 Help Center.

Set up conversions with cart data

Conversions with cart data reporting allows you to measure the number of transactions, revenue, and profit generated by your Search and Shopping Ads. If you use Floodlight activities, you can submit cart data for purchase conversions. By sending the Merchant ID, feed label, feed language, and product data, you can identify which items are selling well and which ones might need more support.

This article explains how to set up and submit cart data with Google tags or Google Tag Manager.

Requirements

To set up conversions with cart data reporting, make sure you:

  • Linked your Google Merchant Center account to your Search Ads 360 account
  • Created a campaign
  • Can modify your website code
  • Use the Floodlight activity as a biddable conversion source in the campaign for optimization

Instructions for Google tags

Step 1 of 2: Create a transaction tag and event snippet

You can also create the Floodlight tag with Campaign Manager 360 or Search Ads 360. If you already have a tag recording transactions, you can skip this step.

  1. Sign in to your Search Ads 360 account.
  2. Navigate to a Search Ads 360 account.
  3. In the navigation menu, select the tools icon.
  4. Under “Measurement”, select Conversions.
  5. Select the conversion action that you want to use, or create a new conversion action.
  6. Under the “Tag setup” section, select Install the tag yourself.
  7. Download the Google tag snippet and event snippet.
  8. Add the Google tag to every page of your site in the <head> tag.
  9. Add the event snippet to the page where the conversion will take place in the <body> tag.

Step 2 of 2: Update the tag with cart data parameters

  1. To your event snippet, add parameters in the format of a JSON items array.

    Each item in the array contains the following parameters:

    • id: The ID of the item sold (must match the ID in your linked Merchant Center feed).
    • price: The price of the item sold.
    • quantity: The quantity of the item sold.
    • country (optional)
    • merchant_feed_language (optional): The language of the feed, represented using the 2-letter ISO 639-1 code.
    • merchant_feed_label (optional): A label identifying the specific feed used within Google Merchant Center.
    • merchant_id (optional): The Google Merchant Center ID of the retailer.
  2. Specify the parameters for the JSON items array using the cart data parameters table.

Example event snippet

The following is an event snippet with cart data parameters:

<!--

Event snippet for Thank You on http://example.com/thanks: Please do not remove.

Place this snippet on pages with events you’re tracking.

Creation date: 11/01/2017

-->

<script>

  gtag('event', 'purchase', 

    {

      'allow_custom_scripts': true,

      'send_to': 'DC-1234567/group1/thank123+transactions',

      'transaction_id': '012345',

      'value': 129.97,

      'items': [

       {  'id': '123456755559',

           'price': 19.99,

           'quantity': 1 

        },

        {  'id': '123456788889',

           'price': 54.00,

           'quantity': 2 

        }

      ],

    'country': 'us',

    'language': 'en',

    'merchant_feed_label': 'MAIN',

    'merchant_feed_language': 'en',

    'merchant_id': 987

    }

);

</script>

<noscript>

<img src="https://ad.doubleclick.net/ddm/activity/src=1234567;type=group1;cat=thank123;

qty=1;cost=129.97;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;tfua=;npa=;

ord=012345;prd=i1:123456755559|p1:19.99|q1:1|i2:123456788889|p2:54.0|q2:2|c:us|l:en?" width="1" height="1" alt="">

</noscript>

<!-- End of event snippet: Please do not remove -->

 
Note: Event snippets generated by Search Ads 360 include an optional <noscript> tag that contains a Floodlight image tag. This tag is used to report conversions in browsers that don't support JavaScript. If your site supports browsers that haven't enabled JavaScript, it's recommended that you update the Floodlight image tag to include cart data parameters as shown in the example.

Example event snippet with country and language codes

You can use Merchant Center to submit your products in multiple feeds, each targeted to a specific language and country. For example, if you sell the same products in the US and Canada, you might set up 3 feeds with the following target countries and languages:

  • US prices and English descriptions
  • Canadian prices and French descriptions
  • Canadian prices and English descriptions

When you submit feeds with the same product IDs but different target languages or countries, you'll need to include the language and country code in your cart data parameter.

The following is an example of an items array for a feed targeted to French Canadians:

 

'items': [

     {  'id': '123456788889',

        'price': 19.99,

        'quantity': 1 

     },

     {  'id': '123456755559',

        'price': 54.00,

        'quantity': 2 

     }

    ],

'country': 'ca',

'language': 'fr',

'merchant_feed_label': 'MAIN',

'merchant_feed_language': 'fr',

'merchant_ID': 987

Instructions for Google Tag Manager

Google Tag Manager helps you maintain tags on your site. Instead of adding and updating tags directly on your site, you add and update them in Google Tag Manager. Google Tag Manager then outputs properly formatted tags on your site as needed. Learn more about Google Tag Manager.

Step 1 of 2: Create a transaction tag and JSON array

  1. Create a Floodlight Sales tag in Search Ads 360 or Campaign Manager 360. Learn about Google Tag Manager's Floodlight sales tags.
  2. Add the tag to your Google Tag Manager container. Learn about how to Set up and install Google Tag Manager.
  3. If you are using Google Tag Manager's data layer to pass data, create a JSON ecommerce.purchase.products array.

Example ecommerce.purchase.products array

'ecommerce':{ 

   'purchase':{ 

      'products': [{

         'id': 'String',

         'price': 'Floating point',

         'quantity': Integer,

         'country': 'String', // Optional

         'language': 'String', // Optional

         'accountId': 'String' // Optional

      },

      {

        … // Each SKU (product) in the transaction

 

          // is in its own array item.

      }]

   }

}'

Step 2 of 2: Update the tag with Google Tag Manager

When you need to pass dynamically generated data to tags managed by Google Tag Manager, you can do either of the following:

Use data from the data layer

If your web developer has made the purchase-details variable available in the data layer, follow these steps to pass the data to your Floodlight tag:

  1. Use the dataLayer.push method to make the data available in Google Tag Manager's data layer.
  2. In Google Tag Manager, navigate to the container for your site.
  3. Select the Tags tab and click the Floodlight transaction tag that reports sales.
  4. Select the Pencil icon to make changes to the tag.
  5. Under Product Reporting, check the Provide product-level sales data check box.
  6. From the "Data Source" list, select Data Layer.
    Google Tag Manager will automatically use the data pushed to the data layer in the ecommerce.purchase.products array.
  7. Select Save.
  8. Preview and publish your changes.

Use a variable to access other data

If your cart data parameters are not available in the data layer, you can use a Google Tag Manager variable to pass the data on.

  1. In your Google Tag Manager container, open your Floodlight Sales tag.
  2. Under “Product Reporting”, select the Provide product-level sales data check box.
  3. Select Custom configuration from the “Data Source” dropdown.
  4. Select the Add variable icon in the following fields:
    • Product Data
    • Merchant ID
    • Feed Label
    • Feed Language
  5. Select the New variable button in the upper right.
  6. Select the pencil icon in the “Variable Configuration” card and select the appropriate variable type.
  7. In the next field, enter the name of the object that contains the data.
  8. Perform the necessary edits on the variable and click Save. After doing this, you should see the name of the variable enclosed in double brackets in the Product Reporting fields.
  9. Select Save.

Cart data fields

See the following table describes the type, example values, and descriptions required for cart data parameters:

Parameter Type Example value Description
id String "98765" The ID of the product that has been sold. The ID must match the item id from Google Merchant Center.
price Float 1.50 Sales price of a single item, excluding tax, shipping, and any transaction level discounts.
quantity Integer 2 Number of units sold of the items.

country (optional)

String "840"

The country associated with the feed where your items are uploaded. Use ISO 3166 country codes.

This field is needed only when item IDs are not unique across multiple Merchant Center feeds.

merchant_feed_label (optional) String "MAIN" A label identifying the specific feed used within Google Merchant Center.
merchant_feed_language (optional) String "fr" The language of the feed, represented using the 2-letter ISO 639-1 code.
merchant_id (optional) Integer 987 The Google Merchant Center ID of the retailer.

Report on profit margins (optional)

If you want to report on profit margins, you must provide the cost of goods sold feed attribute in your Google Merchant Center product feed. Learn how to Enable reporting on profit margins.

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

Search
Clear search
Close search
Main menu
1462698816665090830
true
Search Help Center
false
true
true
true
true
true
5055977
true
false
false
false