Server-side tagging for WordPress

Ira Holubovska

Ira Holubovska

Author
Updated
Jun 30, 2026
Also available in

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.

What is WordPress server-side tagging?

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.

Main benefits of server-side tracking for WordPress

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.

WordPress Conversion Tracking app by Stape

i

Note:

Stape has ready-made GTM templates for WooCommerce. They're easy to set up and don't require any coding skills. Check out our guide to get everything up and running fast. You can also try the Setup Assistant feature, which lets you select the platforms you use and generates pre-built templates for both your web and server GTM containers. The templates are then automatically imported into your container.

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.

1. Inserts the Google Tag Manager script on your website

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.

GTM server-side for WordPress

2. Sends dataLayer events to the web GTM container

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

- Email

- And more.

Stape Conversion Tracking app for WordPress

3. Sends webhooks

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.

How to set up WordPress server-side tracking

1. Log into your WordPress admin panel and go to PluginsAdd New → search for "Stape Conversion Tracking" → select the Stape Conversion Tracking app → click Install Now. Once installed, click Activate.   

Conversion Tracking app for WordPress by Stape

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 +.

Set up server GTM

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

Set up server GTM

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.

Set up server GTM

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.

Create Container
Create container on Stape

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.

Running container on Stape

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 AdminContainer Settings and paste the domain URL you see inside your Stape container. Using a custom domain is highly recommended.

Paste tagging server URL
Add custom domain

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.

Stape Conversion Tracking app

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

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

Conclusion

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.

Want to start on the server side? Register now!

author

Ira Holubovska

Author

Ira has 10+ years of digital marketing experience, with the last 5 focused on server-side tracking. She understands how and when it works across various digital marketing scenarios.

Comments

Try Stape for all things server-side