Encoding pixel tracker through Iglu Webhook payloads

Hi there!

I was building the data payload for the snowplow pixel tracker using the iglu webhook which was quite straightforward using this excellent tutorial.

I am using this pixel in email campaigns and the data sent in the url query could contain long strings as well as personal data like user emails. eg.

https://collector3.custom.com/com.snowplowanalytics.iglu/v1? schema%3Diglu%3Acom.custom.iglu%2Fpage_open%2Fjsonschema%2F1-0-0%26issueID%3D1213%26issueCategories%3DAction%2C%20How%20to%20live%26pageUri%3D%20http%3A%2F%2Fgithub.com%26openType%3Demail_open%26subscriberEmail%3Djohn%40doe.com

Hence I was wondering if there is a way to encode/obfuscate (even base64) this query data (similar to how its done when sending custom unstructured event data with the url redirect event (through the ue_px parameter). This would at least provide for a basic level of protection of data.

Thanks very much!

Are you embedding the pixel within an email?

Unless you already have access to an encoded or obfuscated email address within the template I don’t think it will be possible to obfuscate as you won’t be able to execute Javascript within the email before the network request for the pixel is fired.

hi Mike

Yes - this is part of an email template. I can obfuscate the email once its substituted within the email campaign manager (Sailthru). But once I do that, the webhook will also capture the obfuscated email, which is not what I need…

The primary objective is to simply obfuscate the pixel url so its not readable by scanning the email source code easily but still allow the webhook to get fired and track the data.

You have a way set to do this with the uri_redirect event through the ue_px param but not sure if a similar approach is possible here.


If you’re using the pixel tracker you should be able to pass through ue_px as base64 encoded JSON and this should work without any issues.

Thanks Mike!

But I am not clear how I can convert the following format into a babse64 format. Where can I use the ue_px param in this string?

<img src='https://collector.custom.com/com.snowplowanalytics.iglu/v1?schema=iglu%3Acom.custom.iglu%2Fpage_open%2Fjsonschema%2F1-0-0&subscriberEmail=john%40doe.com&categories=Action&pageUri=http%3A%2F%2Fc.github.com%2F' />

As you can see, this url is fired as an image src for a pixel using the iglu webhook format.

If you mean that I cannot use an iglu webhook if I need to obfuscate the url, then how can I send additional data to the event (or even a custom unstructured event)? From the wiki page, I seem to have only a few params available eg.

<img src="http://collector.acme.com/i?&e=pv&page=Root%20README&url=http%3A%2F%2Fgithub.com%2Fsnowplow%2Fsnowplow&aid=snowplow&p=web&tv=no-js-0.1.0" />


UPDATE: I was able to send the data as an unstructured event to the pixel through the pixel tracker with ue_px base64-encoded event data, so thats a good step. However, it would have been useful to try to use base64 format with the webhook approach as well…


You’ll be able to pass ue_px for the Pixel tracker but not for the Iglu Webhook endpoint (as it only expects schema and data). If you absolutely need to use the Iglu webhook endpoint you may be able to send in the obfuscated email and then deobfuscate the email using a Javascript enrichment.

Thanks Mike!

Thats what I suspected. Using the webhook format would make it easiler to implement and scale for the frontend developers in the team, but the pixel tracker does the job well enough along with protecting the data at a basic level!

One question re the pixel tracker: is there any way to suppress its firing when being previewed in the template? It wont make sense to track the impressions when the template with the pixel is loaded into the campaign manager and previewed by the editors…I doubt it but wondering about how such events are handled in general…


Does the preview pane have an email associated with it in the preview mode? If not you may be able to use some Zephyr logic to conditionally render the pixel if an email is not undefined.