Discover how to set up server-side tracking using Stape.io, a powerful tool that enhances data security, improves data accuracy, and optimises page load speed. Whether you prefer reading the step-by-step guide or watching the instructional YouTube video below, this post will provide all the information you need to get started..
Why Choose Server-Side Tracking?
- Enhanced Data Security: Server-side tracking ensures that sensitive data isn’t exposed in the browser, reducing the risk of data breaches and unauthorised access.
- Improved Data Accuracy: By using first-party cookies and bypassing third-party cookie blockers, server-side tracking delivers more reliable data, essential for accurate analytics and marketing efforts.
- Optimised Page Load Speed: Offloading data processing to the server lightens the browser’s load, resulting in faster page load times and a better user experience.
With Stape IO, setting up server-side tracking becomes simple and cost-effective. For instance, you can handle up to 500,000 requests per month for as little as $20, making it an excellent choice even for small websites.
Step-by-Step Guide to Setting Up Stape IO
1. Create a Stape IO Account:
Start by signing up for a Stape IO account. The registration process is straightforward. Once logged in, create a new container and name it using the website that you are migrating to server-side GTM.
2. Configure the Container in Stape.io:
You’ll need to set up a new server container. Go to GTM, create a new server container, and select “Manually Configure” and copy the container configuration key. Back in Stape IO, paste this into the “Container configuration” field, and select a server location based on your traffic’s location. Make sure you agree the server location with your client, because you can’t change the location once it has been saved.
3. Select a Stape.io Pricing Plan:
Stape IO offers a variety of plans, including a free option. If you plan to create a custom subdomain for your domain, opt for a paid plan to enable direct data transfers, bypassing third-party cookies. This is an important benefit of server-side GTM, and so I would recommend you purchase a paid plan.
4. Domain and DNS Configuration:
If you have a paid plan, and have created a new sub-domain for the purpose, select “Create a custom domain”. Enter the full URL of the new sub-domain (e.g. https://data.yoursitedomain.com) in the “Domain name” field. For custom domains, Stape IO generates the required DNS records. Update these in your website’s admin area or ask your client to do so.
For WordPress users, the Stape IO plugin simplifies this setup. If the client uses a Content Delivery Network (CDN), such as Cloudflare, choose “Other CDNs” and this will generate a CNAME end-point. Share the CNAME with your client and also the link to configure other CDN’s. Otherwise, you can use Stape.io’s own CDN.
5. Server Container Configuration:
Use the sub-domain name and configure the server container in GTM. Go to Variables and enable “Client name” and then we will set up a new tag for GA4. It’s advisable to create a test property initially to avoid any loss of data during the migration process. We recommend you retain your client-side GTM tracking code, until we have verified your server-side data is flowing as expected.
6. Setting Up Triggers and Tags:
In your server container, create a trigger to send all events to GA4. Go to “Triggers” and create a new trigger. Call it something like “GA4 – All Events”. Select Trigger type as “Custom” and select “Trigger fires” and set to “Client name” equals and enter “GA4”. Go to Tags and create a new tag type of “Google Analytics (GA4)” and paste into the field “Measurement ID” your GA4 property or create a new “Constant variable” for the ID.
Add the trigger we just created and save. We recommend you initially send the data to a new server-side test GA4 property. This will allow you to compare the data from server-side with client-side before switching fully to server-side tracking. This means creating separate “Constant” Measurement ID variables for your GA4 live property and for your server-side test property.
Use the variable for the server-side GA4 property only until you have validated the data. Once you are happy to switch, change the Measurement ID in your “GA4 – All Events tag” from the server-side GA4 test property to your GA4 Live property.
7. Configure Server GTM Settings:
In the server-side container, to to “Admin” > “Container Settings”, and enter the sub-domain to the “Server container URL” field (e.g. https://data.yourdomain.com). This ensures that data is correctly routed from the web to your own domain. This allows you to use 1st party cookies for sending data and will minimise the impact of cookie and advertising blockers.
8. Configure Web Container:
Go to your web container. Go to the Google Tag in the Tags section and click “Add parameter” and enter “server_container_url” and as the output, enter your server-side GTM (e.g. https://data.yourdomain.com) and save the changes.
You will then need to add this parameter to all events in the container. You can do this most easily by adding this to your Shared Settings Variable which should be added to all your GA4 events. If you do not already have a Shared Settings Variable, I would create one and add “server_container_url” as a parameter to the variable. This will speed up the process of adding parameters to all your GA4 event tags.
9. Testing and Validation:
Use GTM “Preview Mode” to test the setup by previewing both web and server containers. Use the network tab in your browser’s developer tools to verify that data is sent to the correct domain and not to Google. You should also check to see events being received in the GA4 console by checking the “Debugview” in the Admin section.
Conclusion
Stape IO makes server-side tracking accessible and affordable, especially for small to medium-sized businesses. The benefits of server-side tracking, including improved data security, accuracy, and page load speeds, make it a worthwhile investment. By following this guide, you can set up server-side tracking efficiently and start reaping the benefits for your website.
Thank you for reading, we hope you found this helpful. If you’re considering server-side tracking, we would highly recommend it for enhancing your site’s performance and data management. Don’t hesitate to contact us at Conversion Uplift if you have any questions or need further assistance!
Finally, you can read more of our blog posts here.



















