Proper Google Ads conversion tracking is essential for measuring campaign performance and using advertising budgets efficiently. This guide comprehensively covers conversion code setup, GTM conversion tracking, Conversion Linker cookie management, and integrating e-commerce cart data into conversion tags.
What Is a Conversion?
A conversion refers to the completion of a desired action on a website or application. Examples include memberships or page views on content sites, purchases on e-commerce sites, form submissions or phone calls for real estate projects.
Conversions can be categorized as macro and micro. A macro conversion represents the primary goal (payment completion), while micro conversions are the steps along the way (product viewing, adding to cart, entering address details).
Benefits of Conversion Tracking
- Measure and optimize keyword, ad, ad group, and campaign performance
- Gain insight into return on investment (ROI) and control ad spending
- Automatically optimize campaigns toward business goals (target CPA, target ROAS, and smart bidding strategies)
Conversion Code Setup
Creating a Conversion Code
Navigate to Tools and Settings > Measurement > Conversions in your Google Ads account to create a new conversion code. Select Website as the conversion type.
In the next step, configure the Value and Count fields:
- Value: Determines how the conversion is reflected when triggered. Use a fixed value or dynamic pricing per conversion.
- Count: Every counts each conversion (purchases), One counts only the first (memberships, request forms).
GTAG Setup
After creating the conversion code, you receive an ID starting with AW-. If GTAG is already present, add the conversion ID as a new config parameter:
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "UA-12345678-1");
gtag("config", "G-123456789");
gtag("config", "AW-123456789");
The script path is irrelevant; it can load UA, GA4, AW, or GTM values. What matters is that the identity values of all accounts requiring data flow are defined in config.
Conversion Triggers
Page load conversion (thank-you page, payment result page, etc.):
gtag("event", "conversion", {
send_to: "AW-123456789/AbC1DE_FgghIJKL2m3NO",
});
Click conversion (link, button, phone number, etc.):
function gtag_report_conversion(url) {
var callback = function () {
if (typeof url != "undefined") {
window.location = url;
}
};
gtag("event", "conversion", {
send_to: "AW-123456789/AbC1DE_FgghIJKL2m3NO",
event_callback: callback,
});
return false;
}
The url parameter specifies the redirect destination after the click. Usage:
<input
type="submit"
value="Submit"
onClick="return gtag_report_conversion('https://example.com/thank-you/')"
/>
In the send_to parameter structure, AW-123456789 is the conversion ID (static across all codes), and /AbC1DE_FgghIJKL2m3NO is the label unique to each conversion definition.
GTM Conversion Tracking
Remarketing Tag
In your GTM container, select Tags > New > Google Ads Remarketing. Enter the numeric value after AW- in the Conversion ID field and select All Pages as the trigger. This tag runs on all pages to collect visitor data.
Conversion Tracking Tag
Select Google Ads Conversion Tracking. Enter the same numeric value in Conversion ID and the unique conversion-specific value in Conversion Label.
Selecting All Pages as the trigger would be incorrect. Define a specific page or action trigger:
Page view conversion: Trigger > New > Page View > Some Page Views > Page Path contains: thank-you
Link click conversion: Only Links > Some Link Clicks > Click Text (or Click URL) contains: phone number
Unless otherwise required, separate conversion codes should be created for each conversion definition.
Conversion Linker
The Conversion Linker is a GTM tag that tracks ad click information in first-party cookies. When a visitor completes a conversion event (pageview, click, etc.), the Conversion Linker associates the ad click data with that conversion.
Setup
Select Conversion Linker in the GTM tag configuration and set the trigger to fire on all landing pages defined in your ads. If conversions can occur across all pages, triggering on all pages is more appropriate.
By default, the Conversion Linker stores ad click information in cookies named _gcl_aw and _gcl_dc.
Customizing Cookie Settings
Name: Cookie prefix, defaults to _gcl. Changing to _gcl2 creates _gcl2_aw and _gcl2_dc cookies.
When changing the cookie prefix, the same prefix must be configured in Ads conversion tracking tags that read from these cookies.
Domain: Defaults to the top-level domain. If different ads serve different subdomains, independent configurations are needed.
Path: Defaults to / (root). Adjust if cookies need to be restricted to a subdirectory.
Shopping Cart Data
Google Ads enables using shopping cart data in e-commerce purchase conversions. This provides detailed insights into which products were sold through ad clicks, revenue, profit, and average cart size.
GA4 vs. Ads Purchase Differences
Unlike the standard GA4 e-commerce purchase object, the cart data purchase event includes additional parameters:
gtag("event", "purchase", {
send_to: "AW-9999999999/abc123xyz",
transaction_id: "1545c34e-691e-4726-aeda-b798df255e9c",
value: 53.5,
currency: "USD",
discount: 1.5,
aw_merchant_id: 98765,
aw_feed_country: "US",
aw_feed_language: "EN",
items: [
{ id: "P12345", quantity: 2, price: 12.5 },
{ id: "P67890", quantity: 1, price: 30.0 },
],
});
Key differences:
aw_merchant_id(optional),aw_feed_country, andaw_feed_languageparameters are addeditem_idinitemsis replaced withiddiscountmoves fromitemslevel to the top level
aw_feed_country and aw_feed_language use CLDR region codes to specify the country and language of the product feed source.
Shopify Cart Data Example
On the Shopify Order Status Page, purchased product data can be pushed to the data layer:
{% for item in line_items %}
orderProductsCart.push({
'id': '{{ item.product_id }}',
'quantity': {{ item.quantity }},
'price': {{ item.line_price | times: 0.01 }}
});
{% endfor %}
The Provide product-level sales data option must be enabled in the relevant Ads conversion tag in GTM.
Cart Data Columns
Orders: Sales associated with ad clicks.
Average cart size: Total item prices divided by number of orders.
Average order value: Revenue from ad clicks divided by number of orders.
Cost of goods sold (COGS): Total operating costs attributed to sold products.
Revenue: Revenue from transactions associated with ad clicks.
Gross profit: Calculated as Revenue - COGS.
Testing and Verification
Search for /conversion in the browser Network tab and verify the following query parameters:
mid: aw_merchant_idfcntr: aw_feed_countryflng: aw_feed_languagedscnt: discountbttype: event typeitem: items.id _ items.price _ items.quantity
Advanced Topics
For a comprehensive guide covering the differences between conversion, remarketing, cart data, and enhanced conversions, the send_to mechanism, user_data scope and precedence behavior, and scenario-based comparisons, see the Google Ads gtag.js: Conversion, Remarketing, and Cart Data Guide.
- 01 In the send_to parameter, the value after AW- is the conversion ID, and the value after the slash is the conversion-specific label
- 02 Remarketing tags should fire on all pages, while conversion tracking tags should only fire with specific triggers
- 03 Conversion Linker tracks ad click information in first-party cookies; default cookies are created as _gcl_aw and _gcl_dc
- 04 Cart data enables tracking which products were sold through ad clicks, along with revenue, profit, and average cart size
- 05 Unlike GA4 purchase events, Ads cart data includes aw_merchant_id, aw_feed_country, and aw_feed_language parameters
+ What is the difference between a remarketing tag and a conversion tracking tag in GTM?
A remarketing tag runs on all pages to collect visitor data. A conversion tracking tag only fires when a specific conversion action occurs.
+ What is the difference between Conversion ID and Conversion Label?
The Conversion ID is the static Ads account number used across all conversion codes. The Conversion Label is a unique identifier generated for each conversion definition.
+ What are macro and micro conversions?
A macro conversion represents the primary business goal (e.g., purchase). Micro conversions are intermediate steps: product page views, add to cart, etc.
+ What is Conversion Linker and why is it needed?
Conversion Linker saves ad click information to first-party cookies, enabling conversion tags to associate with those clicks. It should be triggered on all pages in GTM.
+ What are the differences between GA4 purchase events and Ads cart data purchase events?
Ads cart data includes aw_merchant_id, aw_feed_country, and aw_feed_language parameters. In the items array, id is used instead of item_id, and the discount parameter moves to the top level.
+ How do you test that cart data is being sent correctly?
Search for /conversion in the browser Network tab and verify that query parameters include mid, fcntr, flng, dscnt, bttype, and item fields.