Double Server for the Same Website
Using GTM to track data from the same website with two servers
If you want to set up two data-servers for your website for whatever reason, different configurations, multiple ad-accounts, opposite consent modes, you can do so by setting up two data-servers for you website. This is done by duplicating your Tracklution tags in GTM and adding the target parameter to your duplicated tags with your second container's Tracklution ID.
1. Start with your standard setup
Create a Tracklution container and use the Tracklution GTM template (or the cHTML method) to track your events as you normally would.
Tip: Create variables in GTM for your Tracklution ID, for your Tracklution Domain, and prepare a variable for your second Tracklution ID.
Select Variables, under User-Defined Variables click New → Variable Configuration → Constant → Value, add your Tracklution ID or Domain, give the GTM variable a name and click Save.
2. Add a second Tracklution container
- Create a new Tracklution container.
- Note the second Tracklution ID (e.g. LS-11111111-2).
3. Modify GTM to track events in both containers
In GTM, for each tag you want to use to collect events and data with both containers, copy the tag and add the target parameter to the copy.
The parameter is added to your copy by selecting Custom Parameters and adding Key: target (lower-case) and Value: your second Tracklution ID (or the variable containing it).
Examples using the cHTML method
OBS! Unless the main script is hardcoded on your site, with the cHTML method you need to have a tag with the main script triggered on all pages. This tag does not need to be duplicated, but if it includes the PageView event, you need one new PageView tag separately with the target parameter for your second Tracklution container.
To duplicate a PageView:
<!-- Original tag -->
<script>
tlq('track', 'PageView');
</script>
<!-- Duplication -->
<script>
tlq('track', 'PageView', {target: 'LS-11111111-2'});
</script>Purchase event example (with GTM variables):
<!-- Original tag -->
<script></script>
<script></script>
<!-- Duplication -->
<script></script>
<script></script>Summary
- Create your second Tracklution container and note its ID.
- Create a copy of each GTM tag you want to use to collect events and data with both containers.
- Add the target parameter with the second Tracklution ID.
This setup ensures both Tracklution containers receive the same data at the same time. The same procedure could be performed multiple times to add more Tracklution containers.