How to track multiple events with one structured event call

Hi Guys!
We need to track the term impressions on the page. We managed to setup it with Struck Event call using GTM.

$.each(terms, function( index, term ) {
window.snowplow(‘trackStructEvent’, ‘term’,‘impression’, term, 1, 1);

There can be a lot of terms on the page, consequently, we send multiple calls and that affects page speed.

We want to send all the terms impressions at once. Is it possible to send a bunch of Struct Events with one request?

Hi @Iuliia,

I think you might be looking for POST requests?.

However, it might be simpler to use the out of the box impression tracking, a custom self-describing event? You can define as many fieds as you want and send them all together.

Or, you could send as many custom contexts as you like with the one event - so you could define an impression context, and attach it to eg. a page_view event once per impression/term.

One other option that we’ve used is to send a stringified JSON blob in a single structured event that could then be broken down into multiple data points during analysis.

Hi, Colm
Yes, finally we managed to solve this using custom contexts. Thank you for the hint.

1 Like