Events from Pixel Tracking

See the Overview for details about setting up the Datacoral Collect Events Slice.

For tracking web pages, see Browser JS Tracking. We also support instrumentation in pure html environments like email using tracking pixels with static parameters that are pre-determined at the time of constructing the content (like email).

In the content include an image tag as given below:

<img style="display: none;" src="https://URL_ENDPOINT/i?&env=ENVIRONMENT&apiKey=API_KEY&e=pv&page=EMAIL&url=http%3A%2F%2Fgithub.com%2Fsnowplow%2Fsnowplow&aid=snowplowpx&p=web&tv=no-js-0.1.0" />

Example:

<img style="display: none;" src="https://events.dccustomer.datacoral.io/i?&env=dev&apiKey=YAXuPW7Vyf4Vhdan8TAtmROeehIhQUR59N1Rzar3&e=pv&page=EMAIL&url=http%3A%2F%2Fgithub.com%2Fsnowplow%2Fsnowplow&aid=snowplowpx&p=web&tv=no-js-0.1.0" />

In the above img tag, use the values corresponding to each environment for the query parameters where:

URL_ENDPOINT : The URL of your Datacoral Events API gateway. Ex. events.dccustomer.datacoral.io

API_KEY : The Datacoral API key to authorize the events invocations. Ex. 1js9q5Gqmk2VDv2omx2WI3yUGV0K7b464fWUJXDX

ENVIRONMENT : Set the environment as dev or prod, based on the emitter of the events

NAMESPACE : The name of this Tracker instance to include with events sent to the collector. The namespace argument attached to every event fired by the new tracker. This allows you to later identify which tracker fired which event if you have multiple trackers running. Ex. landing_pages

APP_ID : Name of application to include with events sent to the collector. The application ID is used to distinguish different applications that are being tracked by the same Snowplow stack. Ex. "finance" or "hr"

When sending unstructured event and custom contexts as part of pixel tracking, a URL-safe Base64 encoded values should be used for query parameters ue_px and cx respectively. Format the unstructured event as below:

{
"data": {
"name": "test event",
"data": {
"someProp": "someValue",
"otherProp": "otherValue"
}
}
}

Note: there is a wrapper data element which is not present in the window.datacoral('trackUnstructEvent', ...) call in the Browser JS Tracking example.

Base64 encoding the above value will result in

ew0KCSJkYXRhIjogew0KCQkibmFtZSI6ICJ0ZXN0IGV2ZW50IiwNCgkJImRhdGEiOiB7DQoJCQkic29tZVByb3AiOiAic29tZVZhbHVlIiwNCgkJCSJvdGhlclByb3AiOiAib3RoZXJWYWx1ZSINCgkJfQ0KCX0NCn0=

This value should be passed as ue_px query parameter.

Format the custom context(s) as below

{
"data": [ {
"name": "experiment",
"data": {
"fb_uid": '9999xyz'
}
}]
}

Base64 encoding the above value will result in

ew0KCSJkYXRhIjogWyB7DQoJCSJuYW1lIjogImV4cGVyaW1lbnQiLA0KCQkiZGF0YSI6IHsNCgkJCSJmYl91aWQiOiAnOTk5OXh5eicNCgkJfQ0KCX1dDQp9

This value should be passed as cx_query parameter.

So the final URL will look like

https://events.dccustomer.datacoral.io/i?&env=dev&apiKey=YAXuPW7Vyf4Vhdan8TAtmROeehIhQUR59N1Rzar3&e=pv&page=EMAIL&url=http%3A%2F%2Fgithub.com%2Fsnowplow%2Fsnowplow&aid=snowplowpx&p=web&tv=no-js-0.1.0&ue_px=ew0KCSJkYXRhIjogew0KCQkibmFtZSI6ICJ0ZXN0IGV2ZW50IiwNCgkJImRhdGEiOiB7DQoJCQkic29tZVByb3AiOiAic29tZVZhbHVlIiwNCgkJCSJvdGhlclByb3AiOiAib3RoZXJWYWx1ZSINCgkJfQ0KCX0NCn0=&cx=ew0KCSJkYXRhIjogWyB7DQoJCSJuYW1lIjogImV4cGVyaW1lbnQiLA0KCQkiZGF0YSI6IHsNCgkJCSJmYl91aWQiOiAnOTk5OXh5eicNCgkJfQ0KCX1dDQp9

By default, dvce_created_tstamp column in Redshift will not be populated for pixel events. Instead collector_tstamp column can be used to sort the pixel events.

Optionally, you may include dtm query parameter to the pixel url to identify when the url itself is generated. This will be mapped to dvce_created_tstamp column.