Configure the Aqurate Pixel for your custom server-side solution

Find out how to integrate the Pixel in your custom server-side solution

Basics

API

The POST API calls should be made to https://tracker.aqurate.ai/com.snowplowanalytics.snowplow/tp2.

Events

To ensure complete measurement & attribution of the Aqurate tools, we should receive data for 4 events (named as per GA4 terminology):

  1. view_item

  2. add_to_cart

  3. purchase

  4. gtm.linkClick

We’ll address each individually below.

Payload

The basic structure & definitions of the payload is the same for all events and is shown below (also available in serverside/payload-definitions.json), except for the ue_px and cx parameters which are different for each event.

The parameters with values enclosed by --- should be passed by you, while the other ones are constants (no changes needed).

{
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [
    {
      "e": "ue",
      "tv": "ss-1.0.0",
      "tna": "sp1",
      "p": "web",
      "vid": "1",
      "eid": "--- [STRING] Event ID ---",
      "aid": "--- [STRING] Client ID provided by Aqurate ---",
      "url": "--- [STRING] Page URL ---",
      "refr": "--- [STRING] Referrer URL ---",
      "dtm": "--- [STRING] Timestamp when event occurred, as recorded by client device ---",
      "stm": "--- [STRING] Timestamp when event was sent by client device to collector ---",
      "tz": "--- [STRING] Time zone of client devices OS ---",
      "duid": "--- [STRING] Unique identifier for a user, based on a first party cookie ---",
      "sid": "--- [STRING] Unique identifier (UUID) for this visit of this user_id to this domain ---",
      "cookie": "--- [STRING] Does the browser permit cookies? ---",
      "ua": "--- [STRING] User agent ---",
      "cs": "--- [STRING] Web page's character encoding ---",
      "lang": "--- [STRING] Language the browser is set to ---",
      "res": "--- [STRING] Screen / monitor resolution ---",
      "cd": "--- [STRING] Browser color depth ---",
      "vp": "--- [STRING] Browser viewport width and height ---",
      "ds": "--- [STRING] Web page width and height ---",
      "ue_px": "--- [STRING BASE64] Event entity encoded in Base64 ---",
      "cx": "--- [STRING BASE64] Context entity encoded in Base64 ---"
    }
  ]
}
Here’s a fully filled out example of this payload (also available at serverside/payload.json).
 {
  "schema": "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4",
  "data": [
    {
      "e": "ue",
      "tv": "js-3.15.0",
      "tna": "sp1",
      "p": "web",
      "vid": "1",
      "eid": "980891d3-7380-4429-aca6-407e64c3af51",
      "aid": "debugger",
      "url": "https://www.shop.ro/cumpara/tastatura-hp-450",
      "refr": "https://www.shop.ro/",
      "dtm": "1721228263679",
      "stm": "1721228263683",
      "tz": "Europe/Bucharest",
      "duid": "149bb22c-6b21-48fe-b78b-d048a7dd9890",
      "sid": "1ea05a5b-4832-49c6-956d-8dba75319974",
      "cookie": "1",
      "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Firefox/105.0",
      "cs": "UTF-8",
      "lang": "en-GB",
      "res": "1920x1080",
      "cd": "24",
      "vp": "1123x929",
      "ds": "1106x4179",
      "ue_px": "eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy91bnN0cnVjdF9ldmVudC9qc29uc2NoZW1hLzEtMC0wIiwiZGF0YSI6eyJzY2hlbWEiOiJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy5lY29tbWVyY2Uvc25vd3Bsb3dfZWNvbW1lcmNlX2FjdGlvbi9qc29uc2NoZW1hLzEtMC0yIiwiZGF0YSI6eyJ0eXBlIjoicHJvZHVjdF92aWV3In19fQ",
      "cx": "ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L2NvbnRleHRzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IFsNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9wcm9kdWN0L2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7DQogICAgICAgICJpZCI6ICIxMjMiLA0KICAgICAgICAibmFtZSI6ICJUYXN0YXR1cmEgSFAgNDUwIFdpcmVsZXNzIiwNCiAgICAgICAgImJyYW5kIjogIkhQIiwNCiAgICAgICAgImNhdGVnb3J5IjogIlRhc3RhdHVyaSIsDQogICAgICAgICJwcmljZSI6IDEyMC41MywNCiAgICAgICAgImN1cnJlbmN5IjogIlJPTiIsDQogICAgICAgICJxdWFudGl0eSI6IDENCiAgICAgIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzY2hlbWEiOiAiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsgImlkIjogIjBmMzZmM2Y5LTc4OTItNDY2Yy1iMDg2LWVhMmZmOGJjMmQ4MSIgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5nb29nbGUuYW5hbHl0aWNzL2Nvb2tpZXMvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsgIl9nYSI6ICJHQTEuMS40MjA0MDc4MjkuMTcxMzM1ODQ2MiIgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy5lY29tbWVyY2UvdXNlci9qc29uc2NoZW1hLzEtMC0wIiwNCiAgICAgICJkYXRhIjogew0KICAgICAgICAiaWQiOiAiODIzNTIiLA0KICAgICAgICAiaXNfZ3Vlc3QiOiBmYWxzZSwNCiAgICAgICAgImVtYWlsIjogImludGVncmF0aW9uc0BhcXVyYXRlLmFpIg0KICAgICAgfQ0KICAgIH0NCiAgXQ0KfQ=="
    }
  ]
}

ue_px parameter

The event entity parameter is different for each event. It

  • indicates the type of event

  • for gtm.linkClick, indicates the UTM parameters / CSS classes

To avoid parsing errors, this parameter is a JSON encoded in Base64.

cx parameter

The context entity paratemer is different for each event. It contains

  • eCommerce data (what product was viewed/added/purchased)

  • [when applicable] user data (whether the user is logged in; if yes, the user ID & email)

  • [optional] page view ID

  • [optional] Google Analytics ID from the _ga cookie

To avoid parsing errors, this parameter is a JSON encoded in Base64.

1. view_item

The payload for this event has the same structure shown above in Basics > Payload (also available at serverside/payload-definitions.json).

ue_px parameter

It doesn’t require any customization, only encoding in Base64. It’s shown below (also available at serverside/ue_px/view_item.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2",
    "data": { "type": "product_view" }
  }
}
Encoded in Base64:
ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3Vuc3RydWN0X2V2ZW50L2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IHsNCiAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9zbm93cGxvd19lY29tbWVyY2VfYWN0aW9uL2pzb25zY2hlbWEvMS0wLTIiLA0KICAgICJkYXRhIjogeyAidHlwZSI6ICJwcm9kdWN0X3ZpZXciIH0NCiAgfQ0KfQ==

 cx parameter

The basic structure of the cx parameter for the view_item event is shown below (also available at serverside/cx/view_item-definitions.json).

Note that this parameter is identical for view_item and add_to_cart.

The keys with values enclosed by --- should be filled out by you.
 {
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] Product ID ---",
        "name": "--- [STRING] Product Name ---",
        "brand": "--- [STRING] Product Brand ---",
        "category": "--- [STRING] Product Category/categories ---",
        "price": --- [FLOAT] Product price ---,
        "currency": "--- [STRING] Currency ---",
        "quantity": --- [INT] Quantity ---
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "--- [STRING] [optional] Page view ID ---" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "--- [STRING] [optional] GA cookie ID ---" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] User ID of logged-in user ---",
        "is_guest": --- [BOOLEAN] Whether user is logged-in ---,
        "email": "--- [STRING] Email of logged-in user ---"
      }
    }
  ]
}

Here’s a fully filled out example of the cx parameter for the view_item event (also available at serverside/cx/view_item.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "123",
        "name": "Tastatura HP 450 Wireless",
        "brand": "HP",
        "category": "Tastaturi",
        "price": 120.53,
        "currency": "RON",
        "quantity": 1
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "0f36f3f9-7892-466c-b086-ea2ff8bc2d81" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "GA1.1.420407829.1713358462" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "82352",
        "is_guest": false,
        "email": "integrations@aqurate.ai"
      }
    }
  ]
}

Encoded in Base64:

ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L2NvbnRleHRzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IFsNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9wcm9kdWN0L2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7DQogICAgICAgICJpZCI6ICIxMjMiLA0KICAgICAgICAibmFtZSI6ICJUYXN0YXR1cmEgSFAgNDUwIFdpcmVsZXNzIiwNCiAgICAgICAgImJyYW5kIjogIkhQIiwNCiAgICAgICAgImNhdGVnb3J5IjogIlRhc3RhdHVyaSIsDQogICAgICAgICJwcmljZSI6IDEyMC41MywNCiAgICAgICAgImN1cnJlbmN5IjogIlJPTiIsDQogICAgICAgICJxdWFudGl0eSI6IDENCiAgICAgIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzY2hlbWEiOiAiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsgImlkIjogIjBmMzZmM2Y5LTc4OTItNDY2Yy1iMDg2LWVhMmZmOGJjMmQ4MSIgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5nb29nbGUuYW5hbHl0aWNzL2Nvb2tpZXMvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsgIl9nYSI6ICJHQTEuMS40MjA0MDc4MjkuMTcxMzM1ODQ2MiIgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy5lY29tbWVyY2UvdXNlci9qc29uc2NoZW1hLzEtMC0wIiwNCiAgICAgICJkYXRhIjogew0KICAgICAgICAiaWQiOiAiODIzNTIiLA0KICAgICAgICAiaXNfZ3Vlc3QiOiBmYWxzZSwNCiAgICAgICAgImVtYWlsIjogImludGVncmF0aW9uc0BhcXVyYXRlLmFpIg0KICAgICAgfQ0KICAgIH0NCiAgXQ0KfQ==

2. add_to_cart

The payload for this event has the same structure shown above in Basics > Payload (also available at serverside/payload-definitions.json).

ue_px parameter

It doesn’t require any customization, only encoding in Base64. It’s shown below (also available at serverside/ue_px/add_to_cart.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2",
    "data": { "type": "add_to_cart" }
  }
}

Encoded in Base64:

ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3Vuc3RydWN0X2V2ZW50L2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IHsNCiAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9zbm93cGxvd19lY29tbWVyY2VfYWN0aW9uL2pzb25zY2hlbWEvMS0wLTIiLA0KICAgICJkYXRhIjogeyAidHlwZSI6ICJhZGRfdG9fY2FydCIgfQ0KICB9DQp9

cx parameter

The basic structure of the cx parameter for the add_to_cart event is shown below (also available at serverside/cx/add_to_cart-definitions.json).

Note that this parameter is identical for view_item and add_to_cart.

The keys with values enclosed by --- should be filled out by you.
{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] Product ID ---",
        "name": "--- [STRING] Product Name ---",
        "brand": "--- [STRING] Product Brand ---",
        "category": "--- [STRING] Product Category/categories ---",
        "price": --- [FLOAT] Product price ---,
        "currency": "--- [STRING] Currency ---",
        "quantity": --- [INT] Quantity ---
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "--- [STRING] [optional] Page view ID ---" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "--- [STRING] [optional] GA cookie ID ---" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] User ID of logged-in user ---",
        "is_guest": --- [BOOLEAN] Whether user is logged-in ---,
        "email": "--- [STRING] Email of logged-in user ---"
      }
    }
  ]
}

Here’s a fully filled out example of the cx parameter for the add_to_cart event (also available at serverside/cx/add_to_cart.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "123",
        "name": "Tastatura HP 450 Wireless",
        "brand": "HP",
        "category": "Tastaturi",
        "price": 120.53,
        "currency": "RON",
        "quantity": 1
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "0f36f3f9-7892-466c-b086-ea2ff8bc2d81" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "GA1.1.420407829.1713358462" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "82352",
        "is_guest": false,
        "email": "integrations@aqurate.ai"
      }
    }
  ]
}
Encoded in Base64:
ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L2NvbnRleHRzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IFsNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9wcm9kdWN0L2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7DQogICAgICAgICJpZCI6ICIxMjMiLA0KICAgICAgICAibmFtZSI6ICJUYXN0YXR1cmEgSFAgNDUwIFdpcmVsZXNzIiwNCiAgICAgICAgImJyYW5kIjogIkhQIiwNCiAgICAgICAgImNhdGVnb3J5IjogIlRhc3RhdHVyaSIsDQogICAgICAgICJwcmljZSI6IDEyMC41MywNCiAgICAgICAgImN1cnJlbmN5IjogIlJPTiIsDQogICAgICAgICJxdWFudGl0eSI6IDENCiAgICAgIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzY2hlbWEiOiAiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cvd2ViX3BhZ2UvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsgImlkIjogIjBmMzZmM2Y5LTc4OTItNDY2Yy1iMDg2LWVhMmZmOGJjMmQ4MSIgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5nb29nbGUuYW5hbHl0aWNzL2Nvb2tpZXMvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsgIl9nYSI6ICJHQTEuMS40MjA0MDc4MjkuMTcxMzM1ODQ2MiIgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy5lY29tbWVyY2UvdXNlci9qc29uc2NoZW1hLzEtMC0wIiwNCiAgICAgICJkYXRhIjogew0KICAgICAgICAiaWQiOiAiODIzNTIiLA0KICAgICAgICAiaXNfZ3Vlc3QiOiBmYWxzZSwNCiAgICAgICAgImVtYWlsIjogImludGVncmF0aW9uc0BhcXVyYXRlLmFpIg0KICAgICAgfQ0KICAgIH0NCiAgXQ0KfQ==

3. purchase

The payload for this event has the same structure shown above in Basics > Payload (also available at serverside/payload-definitions.json).

ue_px parameter

It doesn’t require any customization, only encoding in Base64. It’s shown below (also available at serverside/ue_px/purchase.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/snowplow_ecommerce_action/jsonschema/1-0-2",
    "data": { "type": "transaction" }
  }
}

Encoded in Base64:

ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3Vuc3RydWN0X2V2ZW50L2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IHsNCiAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9zbm93cGxvd19lY29tbWVyY2VfYWN0aW9uL2pzb25zY2hlbWEvMS0wLTIiLA0KICAgICJkYXRhIjogeyAidHlwZSI6ICJ0cmFuc2FjdGlvbiIgfQ0KICB9DQp9

cx parameter

The basic structure of the cx parameter for the purchase event is shown below (also available at serverside/cx/purchase-definitions.json), assuming this order contains 2 items:

Note that this parameter is very similar to view_item and add_to_cart.

The difference is that inside the data array you should add a new object for each purchased product.

The keys with values enclosed by --- should be filled out by you.

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
   {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0",
      "data": {
        "transaction_id": "--- [STRING] Transaction ID ---",
        "revenue": --- [FLOAT] Transaction revenue ---,
        "currency": "--- [STRING] Currency ---",
        "payment_method": "--- [STRING] Payment method ---",
        "total_quantity": --- [INT] Total quantity ---
        "tax": --- [FLOAT] Transaction tax ---,
        "shipping": --- [FLOAT] Transaction shipping ---,
      }
    },
{
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] Product 1 ID ---",
        "name": "--- [STRING] Product 1 Name ---",
        "brand": "--- [STRING] Product 1 Brand ---",
        "category": "--- [STRING] Product 1 Category/categories ---",
        "price": --- [FLOAT] Product 1 price ---,
        "currency": "--- [STRING] Currency ---",
        "quantity": --- [INT] Quantity for Product 1 ---
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] Product 2 ID ---",
        "name": "--- [STRING] Product 2 Name ---",
        "brand": "--- [STRING] Product 2 Brand ---",
        "category": "--- [STRING] Product 2 Category/categories ---",
        "price": --- [FLOAT] Product 2 price ---,
        "currency": "--- [STRING] Currency ---",
        "quantity": --- [INT] Quantity for Product 2 ---
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "--- [STRING] [optional] Page view ID ---" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "--- [STRING] [optional] GA cookie ID ---" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] User ID of logged-in user ---",
        "is_guest": --- [BOOLEAN] Whether user is logged-in ---,
        "email": "--- [STRING] Email of logged-in user ---"
      }
    }
  ]
}

Here’s a fully filled out example of the cx parameter for the purchase event (also available at serverside/cx/purchase.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
   {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/transaction/jsonschema/1-0-0",
      "data": {
        "transaction_id": "998877",
        "revenue": 1020,
        "currency": "RON",
        "payment_method": "N/A",
        "total_quantity": 3,
        "tax": 5,
        "shipping": 29
      }
    },
{
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "123",
        "name": "Tastatura HP 450 Wireless",
        "brand": "HP",
        "category": "Tastaturi",
        "price": 120.53,
        "currency": "RON",
        "quantity": 1
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/product/jsonschema/1-0-0",
      "data": {
        "id": "456",
        "name": "Monitor LED Samsung 19in",
        "brand": "Samsung",
        "category": "Monitoare",
        "price": 450.22,
        "currency": "RON",
        "quantity": 2
      }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "0f36f3f9-7892-466c-b086-ea2ff8bc2d81" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "GA1.1.420407829.1713358462" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "82352",
        "is_guest": false,
        "email": "integrations@aqurate.ai"
      }
    }
  ]
}

Encoded in Base64:

ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L2NvbnRleHRzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IFsNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS90cmFuc2FjdGlvbi9qc29uc2NoZW1hLzEtMC0wIiwNCiAgICAgICJkYXRhIjogew0KICAgICAgICAidHJhbnNhY3Rpb25faWQiOiAiOTk4ODc3IiwNCiAgICAgICAgInJldmVudWUiOiAxMDIwLA0KICAgICAgICAiY3VycmVuY3kiOiAiUk9OIiwNCiAgICAgICAgInBheW1lbnRfbWV0aG9kIjogIk4vQSIsDQogICAgICAgICJ0b3RhbF9xdWFudGl0eSI6IDMsDQogICAgICAgICJ0YXgiOiA1LA0KICAgICAgICAic2hpcHBpbmciOiAyOQ0KICAgICAgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNjaGVtYSI6ICJpZ2x1OmNvbS5zbm93cGxvd2FuYWx5dGljcy5zbm93cGxvdy5lY29tbWVyY2UvcHJvZHVjdC9qc29uc2NoZW1hLzEtMC0wIiwNCiAgICAgICJkYXRhIjogew0KICAgICAgICAiaWQiOiAiMTIzIiwNCiAgICAgICAgIm5hbWUiOiAiVGFzdGF0dXJhIEhQIDQ1MCBXaXJlbGVzcyIsDQogICAgICAgICJicmFuZCI6ICJIUCIsDQogICAgICAgICJjYXRlZ29yeSI6ICJUYXN0YXR1cmkiLA0KICAgICAgICAicHJpY2UiOiAxMjAuNTMsDQogICAgICAgICJjdXJyZW5jeSI6ICJST04iLA0KICAgICAgICAicXVhbnRpdHkiOiAxDQogICAgICB9DQogICAgfSwNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS9wcm9kdWN0L2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7DQogICAgICAgICJpZCI6ICI0NTYiLA0KICAgICAgICAibmFtZSI6ICJNb25pdG9yIExFRCBTYW1zdW5nIDE5aW4iLA0KICAgICAgICAiYnJhbmQiOiAiU2Ftc3VuZyIsDQogICAgICAgICJjYXRlZ29yeSI6ICJNb25pdG9hcmUiLA0KICAgICAgICAicHJpY2UiOiA0NTAuMjIsDQogICAgICAgICJjdXJyZW5jeSI6ICJST04iLA0KICAgICAgICAicXVhbnRpdHkiOiAyDQogICAgICB9DQogICAgfSwNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3dlYl9wYWdlL2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7ICJpZCI6ICIwZjM2ZjNmOS03ODkyLTQ2NmMtYjA4Ni1lYTJmZjhiYzJkODEiIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzY2hlbWEiOiAiaWdsdTpjb20uZ29vZ2xlLmFuYWx5dGljcy9jb29raWVzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7ICJfZ2EiOiAiR0ExLjEuNDIwNDA3ODI5LjE3MTMzNTg0NjIiIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzY2hlbWEiOiAiaWdsdTpjb20uc25vd3Bsb3dhbmFseXRpY3Muc25vd3Bsb3cuZWNvbW1lcmNlL3VzZXIvanNvbnNjaGVtYS8xLTAtMCIsDQogICAgICAiZGF0YSI6IHsNCiAgICAgICAgImlkIjogIjgyMzUyIiwNCiAgICAgICAgImlzX2d1ZXN0IjogZmFsc2UsDQogICAgICAgICJlbWFpbCI6ICJpbnRlZ3JhdGlvbnNAYXF1cmF0ZS5haSINCiAgICAgIH0NCiAgICB9DQogIF0NCn0=

4. gtm.linkClick

This event is typically triggered in GTM when an <a> element is clicked, redirecting the visitor to a new page. We require this event in order to measure the impact of our solution.

When sending this event, we:

  • don’t need to know on which product the user clicked (we infer this from the view_item event that immediately follows the link click)

  • need to know the CSS classes or parsed UTM parameters

ue_px parameter

The payload for this event has the same structure shown above in Basics > Payload (also available at serverside/payload-definitions.json).

The basic structure of the ue_px parameter for the gtm.linkClick event is shown below (also available at serverside/ue_px/gtm.linkClick-definitions.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
    "data": {
      "targetUrl": "--- [STRING] URL of the clicked product ---",
      "elementClasses": [ --- [ARRAY] Parsed UTM parameters of the target URL / CSS classes of the anchor that was clicked + CSS classes of the anchor's closest parent that have the '.aqurate-personalize' class --- ]
    }
  }
}

Here’s a fully filled out example of the ue_px parameter for the gtm.linkClick event (also available at serverside/ue_px/gtm.linkClick.json):

{
  "schema": "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
  "data": {
    "schema": "iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1",
    "data": {
      "targetUrl": "https://www.shop.ro/cumpara/tastatura-hp-450",
      "elementClasses": [
        "aqurate-personalize",
        "aqurate-location-pdp",
        "aqurate-endpoint-recs-item-substitutes",
        "productImage"
      ]
    }
  }
}

Encoded in Base64:

ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3Vuc3RydWN0X2V2ZW50L2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IHsNCiAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L2xpbmtfY2xpY2svanNvbnNjaGVtYS8xLTAtMSIsDQogICAgImRhdGEiOiB7DQogICAgICAidGFyZ2V0VXJsIjogImh0dHBzOi8vd3d3LnNob3Aucm8vY3VtcGFyYS90YXN0YXR1cmEtaHAtNDUwIiwNCiAgICAgICJlbGVtZW50Q2xhc3NlcyI6IFsNCiAgICAgICAgImFxdXJhdGUtcGVyc29uYWxpemUiLA0KICAgICAgICAiYXF1cmF0ZS1sb2NhdGlvbi1wZHAiLA0KICAgICAgICAiYXF1cmF0ZS1lbmRwb2ludC1yZWNzLWl0ZW0tc3Vic3RpdHV0ZXMiLA0KICAgICAgICAicHJvZHVjdEltYWdlIg0KICAgICAgXQ0KICAgIH0NCiAgfQ0KfQ==

What to pass in elementClasses inside ue_px

As per this Knowledge Base article, our clients may use one of 2 methods for performance measurement:

  1. Anchors option

  2. UTM option

Thus, the ue_px parameter for the gtm.linkClick event should contain under elementClasses:

  1. the CSS classes of the anchor that was clicked + the CSS classes of the anchor's closest parent that has the class .aqurate-personalize, or

  2. the parsed UTM parameters

Here’s how you can determine both of them.

For simplicity, you can set the value of elementClasses in the ue_px parameter to a concatenation of the 2 functions below (getClasses and getUTMParameters):

// ...
  "elementClasses": getClasses(clickedElement).concat(getUTMParameters(url))
// ...

Anchors option

You can use this function to grab the CSS classes (also available at serverside/getClasses.js):

function getClasses(clickedElement) {
  var closestElement = clickedElement.closest(".aqurate-personalize");
  var elementClasses = clickedElement?.className || "";
  var closestElementClasses = closestElement?.className || "";

  var allClasses = elementClasses + " " + closestElementClasses;
  var classesArray = allClasses.split(" ");

  return classesArray;
}

UTM option

You can use this function to parse the UTM parameters of the <a href=${url}> (also available at serverside/getUTMParameters.js):

function getUTMParameters(url) {
  var utmArray = [];
  var queryString = url.split("?")[1];

  if (queryString) {
    var queryParams = queryString.split("&");

    for (var i = 0; i < queryParams.length; i++) {
      var param = queryParams[i].split("=");

      if (param[0].indexOf("aqurate_") === 0) {
        utmArray.push(param[0].replaceAll("_", "-").concat("-", param[1]));
      }
    }
  }

  return utmArray;
}

cx parameter

The basic structure of the cx parameter for the gtm.linkClickevent is shown below (also available at serverside/cx/gtm.linkClick-definitions.json):

The keys with values enclosed by --- should be filled out by you.

 {
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "--- [STRING] [optional] Page view ID ---" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "--- [STRING] [optional] GA cookie ID ---" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "--- [STRING] User ID of logged-in user ---",
        "is_guest": --- [BOOLEAN] Whether user is logged-in ---,
        "email": "--- [STRING] Email of logged-in user ---"
      }
    }
  ]
}

Here’s a fully filled out example of the cx parameter for the purchase event (also available at serverside/cx/gtm.linkClick.json):

 {
  "schema": "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0",
  "data": [
    {
      "schema": "iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0",
      "data": { "id": "8d0196ef-f48d-4802-ae5b-872fb08d41df" }
    },
    {
      "schema": "iglu:com.google.analytics/cookies/jsonschema/1-0-0",
      "data": { "_ga": "GA1.1.1029081927.1718111222" }
    },
    {
      "schema": "iglu:com.snowplowanalytics.snowplow.ecommerce/user/jsonschema/1-0-0",
      "data": {
        "id": "82352",
        "is_guest": false,
        "email": "integrations@aqurate.ai"
      }
    }
  ]
}

Encoded in Base64:

 ew0KICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L2NvbnRleHRzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAiZGF0YSI6IFsNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93L3dlYl9wYWdlL2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7ICJpZCI6ICI4ZDAxOTZlZi1mNDhkLTQ4MDItYWU1Yi04NzJmYjA4ZDQxZGYiIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzY2hlbWEiOiAiaWdsdTpjb20uZ29vZ2xlLmFuYWx5dGljcy9jb29raWVzL2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7ICJfZ2EiOiAiR0ExLjEuMTAyOTA4MTkyNy4xNzE4MTExMjIyIiB9DQogICAgfSwNCiAgICB7DQogICAgICAic2NoZW1hIjogImlnbHU6Y29tLnNub3dwbG93YW5hbHl0aWNzLnNub3dwbG93LmVjb21tZXJjZS91c2VyL2pzb25zY2hlbWEvMS0wLTAiLA0KICAgICAgImRhdGEiOiB7DQogICAgICAgICJpZCI6ICI4MjM1MiIsDQogICAgICAgICJpc19ndWVzdCI6IGZhbHNlLA0KICAgICAgICAiZW1haWwiOiAiaW50ZWdyYXRpb25zQGFxdXJhdGUuYWkiDQogICAgICB9DQogICAgfQ0KICBdDQp9