Two very, very important releases to server-side #GoogleTagManager. One of them is arguably *the most important* update to the platform in a long, long, time, and the other opens up a myriad of use cases for data enrichment at scale.
Read on!
First, we have ASYNCHRONOUS VARIABLES and PROMISES.
In short, you can use *variables* to run asynchronous operations (such as send HTTP requests or communicate with BigQuery), and anything the variable is attached to *will wait for it to complete*.
This is so useful, as it lets you do complex enrichment / API chaining without having to create custom clients or tags!
The new Promise API can be used to add this functionality to your template code, BUT: the send*, BigQuery, and Firestore APIs are automatically "promisified"!
Well it's a friggin' API for Google's Cloud Firestore database. That's NoSQL, scalable, low latency, atomic, transactional, read/write sync GALORE!
There are *so* many use cases for Firestore. Check out my article below to learn how the new API works, how the new Firestore Lookup variable can be used, and how a simple (but powerful) ecom lookup system can be built trivially with these new features.
It's a great day for server-side GTM users. The enrichment pipe dreams which have been just wishful thinking for over 2 years have finally been realized. There are features I'd still like to see (e.g. event-scoped enrichment), but this is quite enough for now!
The new Server container is now in public beta. You can create a new container in the Admin section of any Google Tag Manager account you have access to.
Server-side tagging is (for now) a @GCPcloud managed environment, which serves as a server-side proxy for all your analytics, marketing, and advertising needs.
See this video for a walkthrough of how to set it up:
So, #GoogleTagManager introduced “server-side tagging”, at SuperWeek, which finally gives me a chance to unload some thoughts about it :)
Server-side tagging translates to a new “Server” container running on a cloud VM in your own domain namespace. 1/6
You send HTTP requests to it from the browser, and it parses these requests (using a new “Client” format), typically dispatching them to their respective endpoints server-to-server (e.g. Measurement Protocol). 2/6
Some amazing things you can do with it:
- Hit validation and fixing before the hit is sent to the endpoint
- PII and privacy controls for the requests before dispatch
- Send same request to multiple endpoints
- Customize the HTTP response back to the client (e.g. Set-Cookie) 3/6