Google Ads conversions and Enhanced Conversions server-side
Your server container already receives the GA4 purchase event with value, currency and transaction ID. Google Ads can use that same event, so you do not need a second stream of data from the browser. In this lesson you add the Conversion Linker and the Google Ads Conversion Tracking tag to the server container, then send hashed customer data with the event so Enhanced Conversions can match more of your sales to ad clicks.
Advanced 12 min read
What you will learn
- Keep the Google Ads click ID in first-party cookies with the Conversion Linker in both containers.
- Fire the Google Ads Conversion Tracking tag in the server container on the GA4
purchaseevent. - Send email, phone and address as user-provided data so Enhanced Conversions can use them.
- Check the conversion in server preview and in the Google Ads diagnostics.
01 How the pieces fit together
When someone clicks an ad, the landing page URL carries a gclid. The Conversion Linker stores it in a first-party cookie (_gcl_aw). When the visitor buys, the GA4 purchase hit reaches your server container, and the Google Ads Conversion Tracking tag there sends the conversion to Google Ads with the click information, the order value and, with Enhanced Conversions, hashed customer data.
- Web container: a Conversion Linker tag and the GA4 tags you already have.
- Server container: a Conversion Linker tag, a Google Ads Conversion Tracking tag and, if you run remarketing, a Google Ads Remarketing tag.
- Google Ads: a conversion action with Enhanced Conversions turned on.
02 Add the Conversion Linker in both containers
In the web container the Conversion Linker reads the click ID from the landing page URL and saves it. In the server container it lets the tagging server handle the Google Ads cookies on sgtm.example.com, so they are set first-party by your own domain.
- 1 In the web container create a tag of type Conversion Linker, trigger it on All Pages and save.
- 2 In the server container open Tags, click New and choose Conversion Linker.
- 3 Trigger it on every GA4 hit: a trigger of type Custom that fires on Some Events with Client Name equals
GA4. The trigger from lesson 4 works as is. - 4 Save the tag.
03 Add the Google Ads Conversion Tracking tag
First get the two IDs of your conversion action. In Google Ads open Goals, then Conversions, open the purchase conversion action and look at its tag setup for Google Tag Manager. It shows a Conversion ID (the number in AW-XXXXXXXXX) and a Conversion Label.
- 1 In the server container create a tag of type Google Ads Conversion Tracking.
- 2 Enter the Conversion ID and Conversion Label from Google Ads.
- 3 Check the value, currency and transaction ID fields. By default the tag reads them from the event data (
value,currency,transaction_id) that the GA4 purchase hit carries. Fill them in only if you need different values. - 4 Create a trigger of type Custom that fires on Some Events with two conditions: Client Name equals
GA4and Event Name equalspurchase. - 5 Name the tag, for example
Google Ads - purchase, and save.
Google Ads uses the transaction_id to drop duplicate conversions for the same order, so send the real order number, as in the previous lesson.
04 Send user-provided data for Enhanced Conversions
Enhanced Conversions add customer data from the order (email, phone number, name and address) to the conversion. Google matches it with signed-in Google accounts, which recovers conversions that cookies alone miss. Google tags normalise the values and hash them with SHA-256 before they are sent to Google.
Push the data with the purchase, in a user_data object next to ecommerce:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({ ecommerce: null });
window.dataLayer.push({
event: 'purchase',
user_data: {
email: '[email protected]',
phone_number: '+48123456789',
address: { first_name: 'Jan', last_name: 'Kowalski', postal_code: '00-001', country: 'PL' }
},
ecommerce: {
transaction_id: 'T-10293',
value: 129.90,
currency: 'EUR',
items: [{ item_id: 'SKU-1', item_name: 'Shoes', price: 129.90, quantity: 1 }]
}
});- 1 In the web container create Data Layer Variables for the fields, for example
user_data.email,user_data.phone_numberanduser_data.address.postal_code. - 2 Create a variable of type User-Provided Data, choose manual configuration and map each field (email, phone, first name, last name, postal code, country) to the matching Data Layer Variable.
- 3 In the Google tag add a configuration parameter
user_datawith the User-Provided Data variable as its value. If you only want it on the purchase, adduser_dataas an event parameter of the GA4 event tag instead. - 4 In Google Ads open Goals, then Settings, expand Enhanced conversions for web, turn it on, choose Google Tag Manager as the method and accept the customer data terms.
The data now travels with the GA4 hit to sgtm.example.com, and the Google Ads Conversion Tracking tag in the server container sends it on with the conversion. You do not configure anything extra in the server tag.
05 Consent decides what Google Ads receives
The GA4 hit carries the visitor's consent state to the server container, and the Google Ads tags there respect it. For a full conversion with click cookies and customer data, ad_storage and ad_user_data must be granted, as set up in lesson 6.
-
ad_storagedenied: no Google Ads cookies are read or written, so the conversion cannot be tied to the click through them. -
ad_user_datadenied: user-provided data is not used for advertising, so Enhanced Conversions have nothing to match. -
ad_personalizationdenied: the visitor is not added to remarketing audiences.
06 Verify the conversion
Open Preview in both containers. Land on the site with a test parameter such as ?gclid=test123, accept all consent, and place a test order.
- Web preview: the Conversion Linker fires on page load and the
_gcl_awcookie exists on your domain. - Server preview: on the
purchaseevent both the Conversion Linker andGoogle Ads - purchaseare under Tags Fired. - Server preview: the Outgoing HTTP Requests show a request from the Google Ads tag to a Google Ads domain such as
googleadservices.comwith a successful status. - Server preview: the event data contains
user_data, andvalue,currencyandtransaction_idare set. - Google Ads: after a few days the conversion action and its Enhanced Conversions diagnostics show recorded conversions and matched customer data.
Frequently asked questions
Do I still need the Google Ads conversion tag in the web container?
No. The server-side tag sends the conversion from the GA4 purchase event. Keeping both would count each order twice unless both send the same transaction_id. Keep only the Conversion Linker in the web container.
Should I hash the email myself before pushing it?
Not with the manual User-Provided Data variable: Google tags normalise and hash the values for you. If you prefer to push already hashed values, they must be normalised and SHA-256 hashed exactly as Google describes in its Enhanced Conversions documentation.
Why is there no conversion in Google Ads after a test order?
A test order without a real ad click often is not attributed to a campaign. Check server preview first: if the Google Ads request left the server with a success status and consent was granted, wait a day before looking again.
Ready to put it into practice?
Deploy a server GTM container on your own domain in a few minutes. The Free plan needs no card.
Create a free account