Set up and test reporting with conversions with cart data

Step 1: Choose and deploy an appropriate implementation method

Conversions with cart data rely on existing conversion tracking for your website or app. Choose the implementation method based on how existing conversion tracking is being deployed.

Check with your web developer on how to pass dynamically generated data, such as product IDs for products that were sold as part of a conversion.

Choose how you want to set up conversions with cart data:

Set up with Google Ads

If you choose Google Ads as an implementation source, you will be able to deploy this using Google Tag directly on your website or via Google Tag Manager. Follow below steps for this implementation method:

  1. Make sure that standard conversion tracking is already set up to track your purchases.
  2. Ensure that the Purchase conversion's "Conversion goal and action optimization" is set to Primary.
  3. Add conversions with cart data parameters to standard conversion tracking to enhance data and report metrics. Learn more about conversions with cart data parameters.
    1. Adding the optional Merchant Center parameters will enhance data quality. This is especially important if you have multiple Merchant Center accounts that use the same item IDs for different products.

Example of Google tag implementation with cart data

<!-- Sample Code Conversion -->
<script type="text/javascript">
gtag(
'event', 'purchase', {
  
"send_to": "AW-9999999999/abc123xyz",
  "transaction_id": "1545c34e-691e-4726-aeda-b798df255e9c",
  "value": 53.50,
  "currency": "USD",
<!-- Start of CwCD Parameters -->
  "discount": 1.50,
  "aw_merchant_id": 98765,
  "aw_feed_country": "US",
  "aw_feed_language": "EN",
  "items": [
    {
      "id": "P12345",
      "quantity": 2,
      "price": 12.50
    },
    {
      "id": "P67890",
      "quantity": 1,
      "price": 30.00
    }
  ]

<!-- End of CwCD Parameters -->
});
/* ]]> */
</script>

Example of a data layer implementation

<!-- Sample Code datalayer push -->
dataLayer.push({
"event": 'purchase',
"transaction_id": "1545c34e-691e-4726-aeda-b798df255e9c",
"value": 53.50,
"currency": "USD",
<!-- Start CwCD Parameters datalayer push -->
"discount": 1.50,
"aw_merchant_id": 98765,
"aw_feed_country": "US",
"aw_feed_language": "EN",
"items": [
  {
    "id": "P12345",
    "quantity": 2,
    "price": 12.50
  },
  {
    "id": "P67890",
    "quantity": 1,
    "price": 30.00
  }
]
<!-- End CwCD Parameters datalayer push -->
});

Set up with Google Analytics

If you choose Google Analytics as an implementation method, via eCommerce tracking, here are the steps for implementation:

  1. Ensure that eCommerce tracking is set up where item_id matches the Merchant Center item_id feed. Learn more about how to measure eCommerce.
  2. Add conversions with cart data parameters such to enhance data and report metrics. Review the conversions with cart data parameters section above.
    • Adding the optional Merchant Center parameters will enhance data quality. This is especially important if you have multiple Merchant Center accounts.
  3. Import eCommerce into Google Ads. Learn more about how to Import Google Analytics conversions into Google Ads.
  4. Ensure that the Purchase conversion's "Conversion goal and action optimization" is set to Primary.

dataLayer.push({
event: ”purchase”,
ecommerce: {
    transaction_id: ”T_12345,
    value: 7.77,
    tax: 4.90
    shipping: 5.99,
    currency: “USD”,
    coupon: “SUMMER SALE”,
    aw_merchant_id: “12345”
    aw_feed_country: ‘US”
    aw_feed_language: “EN”

    items: [
    {
    item_id: “SKU_12345”,
    item_name: “Stan and Friends Tee”,
    affiliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 2.22,
    index: 0,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “green”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 9.99,
    quantity: 1
    }]

Set up with Search Ads 360

Follow the steps below for this implementation method:

  1. Make sure that conversions are already tracked via Floodlight activities.
  2. Update Google Tag or Google Tag Manager with parameters to enhance data and report metrics.
  3. Floodlight data will be passed automatically from Search Ads 360 to Google Ads after they are linked.

Set up to track app conversions

Conversions with cart data supports measuring app conversions via Google Analytics for Firebase (GA4F). To track conversions on your app, follow the steps below:
  1. If you haven’t already set up Google Analytics for Firebase (GA4F) SDK on your app, follow implementation steps 1-8 from Track mobile app conversions with Google Analytics.
  2. Track  “purchase” events in your app.   “item_id” should be the Merchant Center item_id feed
  3. Import the purchase event into Google Ads by ensuring the new conversion action is set to Primary and counts towards the “Purchase” goal.
  4. If you are already using Google Tag Manager you can continue to use it with Firebase for iOS or Android.
  5. Add conversions with cart data parameters such to enhance data and report metrics. Review the conversions with cart data parameters section
    1. Adding the optional Merchant Center parameters will enhance data quality. This is especially important if you have multiple Merchant Center accounts.

Example of an Android implementation

  1. Bundle product1 = new Bundle();
  2. product1.putString( FirebaseAnalytics.Param.ITEM_ID, "12345" );
  3. product1.putDouble( FirebaseAnalytics.Param.PRICE, 34.00D );
  4. product1.putString( FirebaseAnalytics.Param.CURRENCY, "EUR");
  5. product1.putLong( FirebaseAnalytics.Param.QUANTITY, 2 );
  6.  
  7.  
  8. Bundle product2 = new Bundle();
  9. product2.putString( FirebaseAnalytics.Param.ITEM_ID, "67891" );
  10. product2.putDouble( FirebaseAnalytics.Param.PRICE, 29.99D );
  11. product2.putLong( FirebaseAnalytics.Param.QUANTITY, 1 );
  12.  
  13.  
  14. // Prepare ecommerce bundle
  15. Bundle ecommerceBundle = new Bundle();
  16. ecommerceBundle.putParcelableArray(FirebaseAnalytics.Param.ITEMS, new Bundle[] {product1, product2});
  17.  
  18.  
  19.  
  20. // Set relevant bundle-level parameters
  21. ecommerceBundle.putString( FirebaseAnalytics.Param.TRANSACTION_ID, "T12345" );
  22. ecommerceBundle.putDouble( FirebaseAnalytics.Param.VALUE, 97.99D );
  23. ecommerceBundle.putString( FirebaseAnalytics.Param.CURRENCY, "USD" );
  24.  
  25.  
  26. // Set new conversion basket specific parameters. Fill out dynamically.
  27. ecommerceBundle.putDouble( "discount", 10.00D ); // Discount
  28. ecommerceBundle.putInt( "aw_merchant_id", 12345 ); // Merchant center ID
  29. ecommerceBundle.putString( "aw_feed_country", "US" ); // Feed country
  30. ecommerceBundle.putString( "aw_feed_language", "EN" ); // Feed Language
  31.  
  32. // Log purchase event with ecommerce bundle
  33. FirebaseAnalytics.logEvent( FirebaseAnalytics.Event.PURCHASE, ecommerceBundle );

 Example of an iOS implementation

  1. NSDictionary *product1 = @{
  2.    kFIRParameterItemID : @"12345",
  3.    kFIRParameterPrice : @34.00,
  4.    kFIRParameterCurrency : @"EUR",
  5.    kFIRParameterQuantity : @2
  6. };
  7.  
  8. NSDictionary *product2 = @{
  9.    kFIRParameterItemID : @"67891",
  10.    kFIRParameterPrice : @29.99,
  11.    kFIRParameterQuantity : @1
  12. };
  13.  
  14. // Prepare ecommerce dictionary.
  15. NSArray *items = @[product1, product2];
  16.  
  17. NSDictionary *ecommerce = @{
  18.    kFIRParameterItems: items,
  19.    kFIRParameterTransactionID : @"T12345",
  20.    kFIRParameterValue : @97.99,
  21.    kFIRParameterCurrency : @"USD",
  22.    // Set new conversion basket specific parameters. Fill out dynamically.
  23.    @"discount" : @10.00, // Discount   
  24.    @"aw_merchant_id" : @12345, // Merchant center ID
  25.    @"aw_feed_country" : @"US", // Feed country
  26.    @"aw_feed_language" : @"EN" // Feed Language
  27. };
  28.  
  29. // Log purchase event with ecommerce dictionary.
  30. [FIRAnalytics logEventWithName:kFIREventPurchase parameters:ecommerce];

 

Was this helpful?

How can we improve it?
Search
Clear search
Close search
Google apps
Main menu
8801792197996420070
true
Search Help Center
true
true
true
true
true
73067
false
false
false