How to trigger from a Google Tag Manager event?

What if some web page sends a specific event to the centralized GTM of the company and I want that event to trigger a workflow passing-in the data received in the event?

Any “Google Tag Manager” node?

Hi @xmontero, I believe fundamentally tag managers like GTM simply inject code into a website. So you could consider calling an n8n webhook URL in this code. Just make sure your n8n webserver is setup correctly to avoid CORS trouble (as such code would be executed by the browser).

Yes and no. It’s not “only” that GTM puts code in the site and that’s all. It also “translates” information. Acts as a “connector” in the Domain Driven Design world. You are “one domain” and “any of the destinations” are “other domains” and you don’t need to “know the API” of the other thing. You just talk to GTM and it “translates” the info.

For example, if in a page I want to have Google Analytics, the Facebook Pixel, the Mautic Pixel… I don’t make the page “send” information to all of them “by my code”. I send for example a “checkoutVisited” event to GTM and it is in the GTM configuration that I say “when a checkoutVisitedp event comes in, send a visitedPageCheckout to Analytics and an initiatePurchase to Facebook”, for example.

Even more I may control conditionals, place variables, etc. For example, in my event I may send a {"price": "33 EUR"} and make GTM to “translate that” into a new object {"amount": 33, "currency":"EUR"} that is passed forward.

The magic of the GTM is that “your code” no longer needs to “understand” the “API of many destinations”. You talk to GTM and it does whatever needed to “convert” to those formats.

In fact, you cannot “directly” put the Facebook Pixel “inside GTM” but you need to use some king of “glue”.

For example this:

A program claiming to be “integration of anything with anything” like n8n should consider this GTM integration.

Thanks for your feedback @xmontero, I’ll convert your question into a feature request so the team can consider implementing this going forward. Make sure to leave a vote in order to register your interest in this.