Detecting Redirect

Hi all,

We’re collecting snowplow events from the frontend via Snowplow Analytics to scala-collector to kinesis to Elasticsearch. We’re currently saving all fields.

We had a load spike today on our website where the vast majority of status codes during spike were 3XX (redirects I’m assuming). I’m trying to use Snowplow Analytics data to find out what pages were causing this (both where redirected from and to). Obviously the snowplow events have this information, but is there anyway to determine a redirect occurred and not just a pageview due to a link/button being clicked? I’d like to essentially sort into two datasets: 1) Normal Pageviews, 2) Pageviews from redirects. Then perform my analysis.

Worst case I just group by and take a look. Since vast majority were redirects, it should be probably be obvious which are redirects…but it would be nice to know exactly if possible.

Thanks for any insights,

There’s no direct way that I’m aware of other than the group by mechanism that you mentioned unless the redirects are decorating the URLs in some way. You can likely filter any URLs out where a link click event is present which should exclude some of this data, or if the redirect is managing to fire page views for both the source and origin page I’d be tempted to look at URLs that have been navigated to within a short period based on derived_tstamp (e.g., < 5 seconds between).

If you want 100% accurate numbers you could look at configuring the cookie enrichment to pick up the ‘Location’ header present on redirects which would give you more accurate numbers (but would require reprocessing / quarantining this data) assuming that you don’t have it configured already.

@pcb, redirects would be recorded as either events or contexts.

If the event doesn’t have an e= param, then it is added with value e=ue (for unstructured event) and the unstruct (self-describing) event itself is a uri_redirect event. In this scenario, the event name is set to uri_redirect.

If the event has an e= parameter (regardless of its value), then uri_redirect is added as a context, even if the parameter is set to ue. If the parameter is set to ue, the event name can be whatever custom name users have given to the unstructured event.