GTM Tutorial
Quick Setup: From GTM Client-Side to Commanders Act Server-Side
Last updated
Quick Setup: From GTM Client-Side to Commanders Act Server-Side
Last updated
This guide shows you how to quickly set up server-side event forwarding for GA4 in Google Tag Manager (GTM) using Commanders Act. With this setup, your GA4 events can be routed to multiple destinations like Facebook CAPI, Google Enhanced Conversions, and others.
Create a GTM Source in Commanders Act.
Update the GA4 URL in GTM.
Set Up Domain Delegation for first-party data collection (strongly recommended).
Instead of using GA4 to transfer events, you can add Commanders Act tags directly in GTM for each event you want to track. While this method takes more time to set up, it gives you full control over which events are sent, independent of GA4, and works even if GA4 is not used.
For more details, check the Commanders Act GTM template documentation.
Log in to Commanders Act.
Go to the Sources section and create a new Google Tag Manager source.
Copy the Source Token displayed.
Open your GTM workspace.
Find your GA4 Configuration Tag.
In the Tag Configuration window, under Fields to Set, add a new field with the following values:
Field Name: server_container_url
Value:
Replace:
{siteId}: Your Commanders Act site ID.
{sourceKey}: The Source Token from Commanders Act.
Note: This URL uses Commanders Act’s default domain (commander1.com
) to get you up and running quickly. For better data quality, it’s strongly recommended to use your own custom domain (see Step 3).
Save and Publish your changes in GTM.
For enhanced data accuracy and first-party tracking, we recommend setting up a custom domain through domain delegation. This ensures the data is collected and processed as first-party, improving tracking reliability and compliance with privacy regulations.
Go to the Domain Management section of Commanders Act (find detailed instructions here) and follow the steps to configure a custom subdomain such as https://collect.yourdomain.com
In GTM, update server_container_url
with your subdomain url such as:
Replace collect.yourdomain.com
with your own subdomain.
Using a custom domain not only improves tracking precision but also helps ensure better compliance with browser and privacy policies.
Once GA4 events are sent to Commanders Act, they can be forwarded to various destinations, such as: Facebook CAPI, Google Enhanced Conversion, Bing Ads, TikTok, Awin, ... And many more through the Commanders Act plug&play destinations catalog.
For users looking to optimize server-side tracking, Commanders Act provides also an option to proxify the GTM JavaScript file to bypass ad-blockers. This solution ensures that consented data can still flow to your analytics tools or partners without being unfairly blocked by ad-blockers that might indiscriminately block GTM scripts, even when used responsibly.
Instead of using the default GTM URL (e.g., https://www.googletagmanager.com/gtm.js?id=XXX
), the script is served from your own domain (e.g., https://track.yourdomain.com/custompath.js
) with a unique path modifier to avoid detection by ad-blockers.
This process helps ensure that only user-consented data is collected and forwarded, in strict compliance with privacy regulations such as GDPR.
Our server-side infrastructure is designed with privacy, consent, and user control at its core. By proxifying the GTM script, you're simply ensuring that consented data can be processed and sent to trusted tools and partners, in line with the user’s preferences. This aligns with best practices in privacy and GDPR compliance, ensuring that ad-blockers do not unfairly interrupt responsible data flows.
If you're interested in setting this up, please contact your account manager for more information.