Are you looking to try server-side tagging for your WordPress website? A server-side Google Tag Manager container is the best solution if you want to track data accurately and report it to analytics or marketing platforms.
This article will explain how to set up Google Tag Manager server-side container in WordPress using the Stape Conversion Tracking app.
Server-side tagging is a new method of implementing tracking that takes place on a cloud server instead of the user's browser. For WordPress sites, this means moving your tracking scripts off the visitor's device and onto a server you control, which makes the website load faster and reduces the chances of data loss due to ad blockers or network errors.
With server-side tagging, all tags and scripts are managed and executed on a separate server, which sends back the necessary data to advertising or marketing instead of requiring the browser to load and execute each script individually. This approach allows for greater control over the tag management process and can help to improve website performance, increase data accuracy, and ensure compliance with data privacy regulations.
As web analytics adapt to modern restrictions and ever-evolving rules, server-side tracking methods are quickly becoming the new standard for user identification. This technology has grown exponentially in popularity over recent years as companies seek more reliable data collection tactics.
1. Increased cookie lifetime
Safari and Firefox's Intelligent Tracking Prevention (ITP) restricts cookie lifetime. Previously, your cookie could live up to 2 years, and now its lifespan is limited to 7 days or even 24 hours.
You can extend the cookie lifetime by implementing tracking on the server environment, which is currently the most straightforward way to reach this goal. If you don't, users who return to your WordPress site after seven days (or, in some cases, 24 hours) will be considered new users. As a result, data quality inside your analytics platform will decrease.
2. Improved data accuracy
Most WordPress site owners see discrepancies between the number of transactions in analytics platforms and their CRM. This happens because of ad blockers and errors inside client browsers with third-party pixels. You can reduce this problem by moving tracking to the server-side with the Custom Loader power-up enabled. With Custom Loader, you can make tracking scripts invisible to ad blockers.
3. Faster page load speed
Heavy JavaScript is one of the most common reasons for decreased site speed. With server-side tagging, you remove third-party pixels from the browser and move them to cloud servers. Google has released a study showing that every 0.1-second reduction in mobile website speed, on average, increases order value by nearly 10%. For WordPress sites that often run multiple plugins and scripts already, this speed gain can make a noticeable difference.
If you're impressed by what a server Google Tag Manager container offers, you'll be happy to hear that adding it to your WordPress website is effortless with our plugin. The plugin is free, though we also offer several pricing plans for our hosting services.
4. Reduced risk of data privacy violations
By managing all tags on the server-side, marketers can ensure that user data is collected and processed in compliance with data privacy regulations, reducing the risk of data privacy violations.
Note:
Stape has developed a Conversion Tracking app to make it easier for WordPress website owners to use the power of server-side tagging. With this app, you can take advantage of features that previously required extensive technical knowledge. Here's what the Stape Conversion Tracking app for WordPress can do.
The Stape Conversion Tracking app can either insert the GTM script on all website pages or work alongside other WordPress plugins that already insert the GTM script. The second option becomes active only when the Stape plugin detects a GTM snippet added via another plugin – in that case, the Stape plugin won't add the GTM script again but will still add all the configured features.
Web Google Tag Manager ID - make sure to add your web Google Tag Manager ID. If you add a server GTM ID instead, it will cause 403 errors.
GTM server container URL - this is the domain you use for your server GTM container. We recommend setting up a custom domain within your website's domain, since it allows you to set first-party cookies.
Stape container identifier - this parameter adds Custom Loader to your GTM script. Follow these steps to find your Stape container identifier.
Cookie Keeper - this power-up is available only if you have a container hosted on Stape. With it, you can continue using the full cookie duration.

This option allows you to send eCommerce data and user data to the data layer. Note that it works only with WooCommerce server-side tracking.
- Select item
- View item list
- Add to cart
- Remove from cart
- Begin checkout
- Purchase
User data:
- Name
- Surname
- And more.

The app can send Purchase and Refund webhooks to the server GTM container. To enable webhooks, add your server GTM container URL and select the events you want to send to sGTM.
1. Log into your WordPress admin panel and go to Plugins → Add New → search for "Stape Conversion Tracking" → select the Stape Conversion Tracking app → click Install Now. Once installed, click Activate.

2. Create a Google Tag Manager Server container if you don’t have one. Go to https://tagmanager.google.com/ and choose the account where you want to create a container. Then, click Admin.
3. Under the container column, click +.

4. Type a container name, choose Server as the target platform, and click Create.

5. On the install pop-up, choose Manually provision tagging server, copy your container config, and paste it into a text editor. You'll need this for the next steps.

6. Sign up for an account on Stape.
7. Once you receive the confirmation email and set your password, create a container. Enter your container name and paste the container config you copied from your Google Tag Manager server container, then click Create Container.


8. After clicking Create, you'll see the status of your container, container config, and plan name. It takes around five minutes to deploy a server container – reload the page to update the status. If the setup was done correctly, you should see the status Running.

If you see Error, check that you've copied and pasted the correct container configuration. If the error persists, contact our support team.
9. Inside your Google Tag Manager server container, click Admin → Container Settings and paste the domain URL you see inside your Stape container. Using a custom domain is highly recommended.


10. Open the Stape Conversion Tracking app you installed in Step 1 and paste your tagging URL into the plugin settings. Next, choose whether to add the web GTM script to all site pages or skip that and only add the plugin's functionality (use this second option if you're already using another plugin that inserts the GTM script on your site).
Then add your web Google Tag Manager ID, tagging server URL, and Stape container identifier if you want to use Custom Loader. Finally, select whether you want to add dataLayer events or send webhooks.

11. Save your changes, open the browser console, and check that the web GTM script is being served through your tagging server URL.

12. Once your server GTM container for WordPress is up and running, you can start configuring server-side tagging for the platforms you need. We have separate guides on setting up server-side Google Analytics 4, Facebook, TikTok, Snapchat Conversions API, etc.
Server-side tagging is a powerful tracking solution, and with the Stape Conversion Tracking app, you can implement it on your WordPress website with relative ease. Now that you know what's involved in setting up a Google Tag Manager server container for WordPress and how it can benefit your site, it's worth taking the time to put it into practice. Keep an eye on any platform changes and adjust your setup as needed to maintain a reliable tracking experience.
If you have questions or need assistance, don't hesitate to reach out – we'd be glad to help.
Comments