Page_view events and custom properties (se_*)


#1

Hi everyone,

If I understand, page_view events are tracked out of the box when implementing snowplow.

The se_* fields (se_category, se_action, …) can be set when using a structured event. My question is, can you push some data into one of the se_* fields for a page_view event? Is there a way to fire a page_view event and in that case, does it overwrite the out of the box page_view event that would have been fired?

Thanks a lot for your help!
Nico


#2

If you’re using something like Google Tag Manager you can just use the a page view trigger to fire both a page view event and a structured event. In the custom HTML field where you would configure the structured event tag itself, you can use GTM variables to populate the fields (category, action, property, label and value) in the event - these can be the same or different from the page view event.


#3

As @jrpeck1989 has mentioned you can’t send structured event values in a single page view event - that is a call to trackPageView.

However you can send custom contexts instead with a page view that will be attached to the event. This often gives a much more expressive way of adding context to an event.

For example to send a page view and a product view on a single call you might do the following

window.snowplow_name_here('trackPageView', null, [{
    schema: "iglu:com.example/product_view/jsonschema/1-0-0",
    data: {
        productId: '1234',
        productName: 'test product'
    }
}]);

As contexts is passed as an array to the trackPageView method you can attach more than a single context here, for example including some information about the page, user and product (which might come from your dataLayer).


#4

Thanks both of you for your answers!