GA structured events GTM


I’m looking to get the structured events defined in GTM in snowplow. I’ve entered the snowplow script in the screenshot below.

I’ve also defined a GA event shown in the screenshot below.

I can see the events in BigQuery but I can not see the se columns of snowplow. The test trigger is just a ‘all link clicks’.

Thanks in advance,

Hi Sam,

It looks like you’re firing two separate things - one is the Snowplow script which includes a Snowplow structured event, which is triggered on page view. The other is a GA script which fires on ‘test-trigger’.

Snowplow won’t pick up GA events - it’s a separate script. If you want a snowplow structured event to fire on every link click, you’d need a html script tag which runs window.snowplow(trackStructuredEvent...), and trigger that.

Incidentally, this custom GTM tag template might be of interest.

1 Like

Ok, how would I be able to trigger this event? Can I just use the GTM triggers for this?

Yes you can use GTM triggers. The only thing to look out for is that the tracker should be initialised before any window.snowplow call is made. So in the example you provided above, if your first trigger is on page load, you’ll be fine to call another tag containing only trackStructuredEvent with another trigger (like on link click as in your example).

Super thanks, I was a bit confused defining the tag.

Regarding to the Community Snowplow tag, is there some good documentation to be found around this tag?

I’m maybe still a little bit confused.

I’ve also installed this snippet at a clients place (without the trackStructEvent). There I get the information they’ve inserted in triggers through the enableLinkClickTracking.

The link I posted looks like pretty detailed documentation to me.

enableLinkClickTracking enables the default tracking of link clicks. It doesn’t track a structured event. If all you need to do is track all link clicks, and the data from link click events are sufficient, then yeah I would just use that. The advice above was specific to the need to track something as a structured event, I assumed link click tracking wasn’t enough.

It seems at this point though, you’ll probably get where you need to be through experimenting with the methods and checking out the JS tracker docs. If the in-built methods give you what you need, then in general it’s easiest to use them, if you need to trigger events specifically at certain points/with certain GTM triggers, then you can do so as I described above. Additionally if standard events are almost enough, but you need something more, you can check out custom entities (aka contexts). :slight_smile:

Ofc if anything’s still confusing let us know.

Hi Colm,

Thanks for taking your time. I figured out why the confusion. Certain events were indeed link clicks where others were a button click. I need to be tracking such a button, without a link. Like eg. a favorite button.

I’ll think I’ll need to invest a bit of time in GTM on how to track these button clicks.

Ah - yes that makes sense. Link click tracking will only track certain html tags. If it’s a button not a link indeed it’d need something custom. Glad I could help! :slight_smile: