We recently had a client test out the Rally Checkout system with their BigCommerce store. As we provided the client with the tracking code for their store via Tag Rocket, we were concerned that they would lose all their advanced checkout and purchase conversion tracking data for all the systems they use:
- Google Analytics 3 – Universal
- Google Analytics 4
- Google Ads
- Facebook Ads
- Microsoft Ads
- Twitter Ads
- Yahoo Ads
In many cases, this means sending product-level data to drive their Dynamic Remarketing campaigns.
Rally was very interested in making this work. So I started looking into a solution. The Rally checkout has an event system to inform us of changes as the user progresses. Rally and I decided it would be best to add third party code to their checkout via the Google Tag Manager (GTM). Using GTM would mean that the store owner only needed to ask Rally to add one tag to the checkout, and then they had complete control to customise how they tracked the checkout process.
This resulted in me writing a GTM Container that supports all the above systems. To a level close to Tag Rocket.
I will first explain how to set up the container. And then I’ll explain a bit about how it all works.
At this point, these tags have been tested in a staging store. I consider it an alpha solution. Please test thoroughly, provide feedback, or even expand on them. The code behind it is available on GitHub.
The solution also does not support dealing with consent at the moment. I’m working with Rally on a robust way to do this.
Setting up the Rally Checkout
If you don’t already have a Rally Checkout, register a demo to determine if their solution suits your needs.
When it comes to accurate tracking, it is vital that the Rally Checkout is in a subdomain for your store. If not, some tracking systems will not connect the user from your store with the user that checked out.
Setting up Google Tag Manager
I won’t detail how to set up and use GTM; there are plenty of better guides on the internet. You need to create an account with Google Tag Manager and then create a Web Container. You could call the container “Tag Rocket Rally Checkout”.
Once you have done that, contact Rally and ask them to add Google Tag Manager to your Rally Checkout using the Containers ID that GTM has provided to you. It looks like GTM-ABCDEFG.
Adding the Tag Rocket Rally Container
Download the latest Tag-Rocket-Rally-Container.json file by browsing to the raw code, right-clicking and selecting “Save as…”.
In the GTM Admin section for the Container, there is an Import Container option. Select that and then chose the container that you have just downloaded. Choose the workspace to import it to, probably Default, and decide how to import, merge is safest. It will highlight what changes will be applied. Confirm and you will have all the tags required to start tracking.
At this point, all the tags are paused. This is because you need to configure each to track using your own accounts. The following sections will explain how to set up each one:
Each tracking system has been placed in its own folder. If you go to the Tags section and sort by the folders you will get the best view of the tags used in each system.
In all cases, some settings need to be set, and then the tracking systems tags can be unpaused.
In the tags section, you can select multiple tags and unpause them all at once. Very handy for tracking systems that use a lot of tags.
Once you are happy with your changes you can submit then publish them.
I’ll start from the top:
This one is nice and simple, just the one tag.
Click on the “Rally Facebook Pixel”, then click on the Tag Configuration. This is where you can set up the tag to send data to your Facebook account. So replace the Pixel ID with your own.
The Product Identifier options are there to help you send product identifiers that match up with your Facebook Catalog. This is important if you want Dynamic Remarketing to work. For Tag Rocket users it should be the same as you have set up in Tag Rocket.
Once you are happy with your settings you can unpause the tag.
In this case, we first need to modify the settings which are in the variables section and named “GA3 Universal Settings”. Change the Tracking ID to yours and Save.
You may want to alter how the tags send product identifiers. This can be set in the “Rally to GA3 dataLayer Events” tag.
Then go back to the tags section and unpause all the tags in the “GA3 Universal” folder.
To track users correctly you will also want to set up a referral exclusion for the two domains involved in your user’s journey. Namely the main store’s website and the checkout domain. If not, the checkout process will be considered as a new session and you will lose the true referral source. In your GA account, go to the “Referral Exclusion List” in the admin section, and add both your store’s domain and the Rally checkout domain.
The first step is to update the settings in the “GA4 Configuration” tag. Namely the Measurement ID.
You may want to alter how the tags send product identifiers. This can be set in the “Rally to GA4 dataLayer Events” tag.
You can then unpause all the tags in the GA4 folder.
Google Ads has a few variables to set up in the Variables section. Edit the “Google Ads Conversion ID” and the “Google Ads Conversion Label” to match your account and purchase conversion.
You also want to make sure the tags send product identifiers that match your product feed. This can be set in the “Rally to Google Ads dataLayer Events” tag. This is important if you want Dynamic Remarketing to work. For Tag Rocket users it should be the same as you have set up in Tag Rocket.
Once done, unpause all tags in the “Google Ads” folder.
Microsoft Ads has one variable to set up in the Variables section. Edit the “Microsoft Ads UET ID” to match your account’s UET ID.
You also want to make sure the tags send product identifiers that match your product feed. This can be set in the “Rally to Microsoft Ads dataLayer Events” tag. This is important if you want Dynamic Remarketing to work. For Tag Rocket users it should be the same as you have set up in Tag Rocket.
Once done, unpause all tags in the “Microsoft Ads” folder.
Another simple one. Edit the Twitter pixel ID in the tag then unpause.
Like Twitter, edit the tag so that it uses your own pixel ID. This time you also want to make sure your product identifiers match those used in your product feed. And then unpause.
How does it work?
I’m running out of time, so will only briefly explain the structure. If anyone wants more details just ask.
Any custom tags I created are based on templates. This enables me to provide nice editors for the people using the tags.
The Rally dataLayer Events tag
As mentioned at the start, Rally has its own events system. I created a custom template tag to listen to those events and convert them into dataLayer events designed to power the checkout flow and purchase tracking needed by the different tracking systems.
|dataLayer event||Event Properties||Notes|
|rally.customer.updated||customer||When the customer edits fields|
|rally.address.updated||address||When the customer edits address fields|
|rally.step.1||cart, discountCodes, customer, address||Checkout started|
|rally.step.2||cart, discountCodes, customer, address||Shipping filled in, on delivery page|
|rally.step.3||cart, discountCodes, customer, address, shippingMethod||Delivery filled in, on payment page|
|rally.step.4||cart, discountCodes, customer, address, shippingMethod||Order complete|
The event properties are placed within a ‘rally’ property in the event.
There are mechanisms to ensure steps are triggered in sequence and not missed or repeated.
For fast checkouts I expect it to fire steps 2 and 3 when the user returns from the fast checkout system. I’m not sure what data is provided when fast checkout is used.
I then added dataLayer variables and triggers to help other tags use this tag.
Event Conversion Tags
Some built-in tags expect certain events and data structures. I built several templated tags to listen to the Rally tags events and then fire new events in the correct format for those built-in tags to listen to:
- Rally to GA3 dataLayer Events
- Rally to GA4 dataLayer Events
- Rally to Google Ads dataLayer Events
- Rally to Microsoft Ads dataLayer Events
Again, I created variables and triggers to support those built-in tags.
The built-in Twitter tag solution is quite simple, so I had it listen directly to the Rally tags events.
Custom Tracking Tags
There are no built-in tags for Facebook or Yahoo, so I developed custom template tags for them and had them work directly off the Rally tags events.