The Google Conversion Events Tag for Google Tag Manager Server-Side allows you to send conversion events directly to Google's advertising platforms (like Google Ads) using the Data Manager API. This server-to-server integration ensures robust and accurate tracking of conversions, independent of client-side restrictions.
The tag is designed to handle both single and multiple conversion event uploads in a single request, with comprehensive support for user data, consent information, ad identifiers, and custom variables.
-
Choose the authentication method:
-
Stape Google Connection (recommended): sign in to the Data Manager API Connection via the Stape admin. This is the easiest way to set up the authentication. How-to.
-
Own Google Credentials: a Service Account impersonation is the simplest way to handle the authentication when using the Own Google Credentials method.
To configure it correctly, you must:
- Enable the Data Manager API in a GCP Project.
- Create a Service Account in this GCP Project.
- Add the
Service Account Token Creator IAMrole (roles/iam.serviceAccountTokenCreator) to the Service Account. - Generate a
JSON Keyfrom this Service Account (how-to) and download it. - Connect the Service Account to the container using the
JSON Keyfile:- If hosting on Stape, use the Service Account power-up.
- If NOT hosting on Stape, follow these instructions.
- Grant the Service Account access to the product you're interacting with (Google Ads, DV360 etc.).
-
-
Add the Google Conversion Events Tag to your server container in GTM from the GTM Template Gallery.
-
Choose the Event Type:
ConversionorPageview.PageviewConversion- Set up your Destination Accounts and Conversion Events, specifying the Advertising Accounts Customer IDs and the corresponding Conversion Event IDs you want to send data to.
- Choose your Conversion Event Mode:
Singleto configure one event's data through the UI, orMultipleto manually provide a pre-formatted array of events. - Configure the Conversion Information, User Data, and other relevant parameter groups. The tag can auto-map many of these fields from a standard GA4 or e-commerce data layer.
❗ If using Enhanced Conversions (user email address, user phone number etc.), ensure you do the following in Google Ads (Goals > Conversions > Settings). These settings must be active for the destination account and its manager (MCC) account, if applicable:
- Accept the Customer Data Terms.
- Enable Enhanced Conversions and Enhanced Conversions for Leads.
- Add a trigger to fire the tag on the appropriate server-side events (e.g., a
page_viewevent or apurchaseevent).
This mode sets the _dm_session_attributes cookie containing a base64 JSON encoded string with the Session Attributes values for conversion event attribution and modeling.
- Default mappings:
- Session Attribute
gad_source:gad_sourceURL Parameter value - Session Attribute
gad_campaignid:gad_campaignidURL Parameter value - Session Attribute
landing_page_url:page_locationEvent Data value - Session Attribute
landing_page_referrer:page_referrerEvent Data value - Session Attribute
landing_page_user_agent:user_agentEvent Data value - Session Attribute
session_start_time_usec: current timestamp of the time when the Pageview tag set the cookie
- Session Attribute
This mode sends the conversion event.
This is where you define which Google Ads accounts and specific conversion actions will receive the data.
- Product: The Google product to send data to (currently Google Ads).
- Operating Customer ID: The ID of the Google Ads account that will receive the conversion.
- Customer ID: The ID of the account used for authorization (e.g., an MCC account). If the operating account is the same as the authorizing account, this can be the same.
- Conversion Event ID: The unique ID for the conversion action in Google Ads.
You can send data in two ways:
- Single Conversion Event: Configure the parameters for a single conversion directly in the tag's UI fields.
- Multiple Conversion Events: Provide a complete, pre-formatted JSON array containing data for up to 2000 conversion events. This is useful for batch uploads.
This section contains the core details of the conversion.
- Parameters: Includes
Transaction/Order ID,Event Timestamp,Currency, andConversion Value.- Auto-mapping: If enabled, the tag will attempt to automatically populate these fields from the incoming event data (e.g.,
transaction_id,currency,value).
- Auto-mapping: If enabled, the tag will attempt to automatically populate these fields from the incoming event data (e.g.,
This section is crucial for matching the conversion to a user. You can provide multiple identifiers to improve match rates.
- Identifiers: Includes
Email Address(es),Phone Number(s), andUser Address(First Name, Last Name, Region, Postal Code).- Auto-mapping: If enabled, the tag will automatically pull user data from common event data keys (e.g.,
user_data.email).
- Auto-mapping: If enabled, the tag will automatically pull user data from common event data keys (e.g.,
- Hashing & Normalization: The tag automatically normalizes and SHA-256 hashes user identifiers if they are provided in plain text, following Google's formatting guidelines.
This section allows you to send click identifiers for attribution. It's as important as the User Data parameters for matching the conversion to a user.
- Click IDs:
gclid,gbraidandwbraid.- Auto-mapping: If enabled, the tag will automatically pull Click IDs from, in this order, Event Data > URL Parameter > Server Cookie > JavaScript Cookie.
- Landing Page Parameters and Session Attributes:
Landing Page User Agent,Landing Page IP AddressandSession Attributes- Auto-mapping: If enabled, the tag will automatically pull Session Attributes from, in this order:
session_attributesEvent Data value >_dm_session_attributesCommon Cookie value >_dm_session_attributescookie set by the Pageview event of this tag.
- Auto-mapping: If enabled, the tag will automatically pull Session Attributes from, in this order:
You can include device details for the conversion event.
- Parameters:
User AgentandIP Address.
This section provides more context about the customer.
- Parameters:
Customer Type(New, Returning, or Re-engaged) andCustomer Value Bucket(Low, Medium, or High).
This section allows for sending product-level details for e-commerce transactions.
- Parameters:
Merchant Center ID,Feed Label,Feed Language Code,Transaction Discount, and a list ofItemswith theirItem ID,Merchant Product ID,Item Quantity, andPrice.- Auto-mapping: If enabled, the tag will automatically pull
Itemsfrom Event Data.
- Auto-mapping: If enabled, the tag will automatically pull
Note: it's required to send at least the Merchant Product ID for each item.
This section allows you to send any additional key-value pairs for custom reporting.
- Parameters: A list of
Variable ID,Variable Value, and optionalDestination References.
⬇️ Click to expand ⬇️
There are 2 simple ways to obtain the Custom Variable ID.
1 - Using Scripts in Google Ads UI
- Open Google Ads.
- Go to Tools > Bulk Actions > Scripts. Tip: use the search bar at the top.
- Click the
+button to a new script and give it a descriptive name. - Paste this code in the script code block:
function main() {
const query = `
SELECT
conversion_custom_variable.id,
conversion_custom_variable.name,
conversion_custom_variable.tag,
conversion_custom_variable.status
FROM conversion_custom_variable
`;
const searchResults = AdsApp.search(query);
console.log('------------------------------------------------------------------------------------------------------');
console.log('# CUSTOM VARIABLES INFORMATION #');
console.log('------------------------------------------------------------------------------------------------------');
console.log(
'NAME'.padEnd(30) + ' | ' +
'TAG STRING'.padEnd(20) + ' | ' +
'STATUS'.padEnd(18) + ' | ' +
'ID (Use this in GTM!)'
);
console.log('------------------------------------------------------------------------------------------------------');
let count = 0;
while (searchResults.hasNext()) {
const row = searchResults.next().conversionCustomVariable;
const status = row.status;
const name = row.name.padEnd(30);
const tag = row.tag.padEnd(20);
const id = row.id;
console.log(`${name} | ${tag} | ${status.padEnd(18)} | ${id}`);
count++;
}
if (count === 0) console.log('No custom variables found in this account.');
console.log('------------------------------------------------------------------------------------------------------');
}-
Give it the requested permissions through the
Authorizebutton. -
Click
Preview. There's no need to clickRun. -
Go to the
Logstab. This is where the Custom Variable ID will show up.Example:
-
Use the Custom Variable ID in the
Variable IDfield of the tag Custom Variables section.
2 - Using DevTools
-
Open Google Ads.
-
Go to Goals > Conversions > Custom Variables. Tip: use the search bar at the top.
-
Open DevTools and go to the Network tab.
-
In the Network tab, search for
ConversionCustomVariableService/List. -
Reload the Custom Variables page.
-
The Network panel should display a request (filtered by the filter added in step 4).
-
Click on this request and go to the
Responsetab. -
The Custom Variable information will be in the array value of the key named
"1". Each item in the array is a custom variable. -
The Custom Variable ID is the key
"1"inside the object. The Custom Variable Name is the key"4".Example:
-
Use the Custom Variable ID in the
Variable IDfield of the tag Custom Variables section.
- Validate Only: If
true, the request is validated by the API but not executed. This is useful for debugging. - Use Optimistic Scenario: If
true, the tag firesgtmOnSuccess()immediately without waiting for a response from the API. This speeds up container response time but may hide downstream errors. - Request-level Consent: Apply
adUserDataandadPersonalizationconsent statuses to all users in the request. This can be overridden at the user level when using the "Multiple Users" mode. - Consent Settings: Prevent the tag from firing unless the necessary ad storage consent is granted by the user.
- Logging: Configure console and/or BigQuery logging for debugging and monitoring requests and responses.
- Step-by-step guide on how to configure Google Conversion Events Tag
- Stape's Data Manager API Connection
- Data Manager API for Conversion Events
- Conversion Event definition
- User Identifiers Normalization Guidelines
- Session Attributes: [1] and [2]
The Google Conversion Events Tag for GTM Server-Side is developed and maintained by the Stape Team under the Apache 2.0 license.

