Example Request with Annotations

The following code shows an example request. Each object is described separately below.

{
  "deviceId": "IMEI-123456789",
  "monetateId": "2.309132816.1519728587304",
  "preview": "6.3.eJyrVkpMTs4vzSuJz0xRsj...",
  "customerId": "87654321",
  "channel": "a-76ca7dd3/p/example.com",
  "events": 
  [    
    {
      "eventType": "monetate:decision:DecisionRequest",
      "requestId": "12345678",
      "filters": 
      [
        "slot_name"
      ],
      "manageImpressions": false,
      "includeReporting": true
    },    
    {
      "eventType": "monetate:context:IpAddress",
      "ipAddress": "79.173.135.170"
    },    
    {
      "eventType": "monetate:context:Coordinates",
      "latitude": "49.566667",
      "longitude": "10.883333"
    },    
    {
      "eventType": "monetate:context:UserAgent",
      "userAgent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11 (KHTML, like Gecko) Safari/3.0.2"
    },    
    {
      "eventType": "monetate:context:ScreenSize",
      "width": 1024,
      "height": 762
    },    
    {
      "eventType": "monetate:context:Metadata",
      "metadata": 
      {
        "language": "en-GB"
      }
    },    
    {
      "eventType": "monetate:context:CustomVariables",
      "customVariables": 
      [        
        {
          "variable": "VariableName",
          "value": "VariableValue"
        }
      ]
    },    
    {
      "eventType": "monetate:context:PageView",
      "url": "https://www.example.com/search",
      "pageType": "search"
    },    
    {
      "eventType": "monetate:context:Referrer",
      "referrer": "http://www.example.com"
    },    
    {
      "eventType": "monetate:record:PageEvents",
      "pageEvents": 
      [
        "myEvent"
      ]
    },    
    {
      "eventType": "monetate:context:ProductThumbnailView",
      "products": 
      [
        "product72",
        "product43",
        "product42"
      ]
    },    
    {
      "eventType": "monetate:context:ProductDetailView",
      "products": 
      [        
        {
          "productId": "product72",
          "sku": "product72-large-green"
        },        
        {
          "productId": "product43",
          "sku": "product43-medium-striped"
        },        
        {
          "productId": "product57"
        }
      ]
    },    
    {
      "eventType": "monetate:context:Cart",
      "cartLines": 
      [        
        {
          "sku": "product72color2",
          "pid": "product72",
          "quantity": 2,
          "currency": "GBP",
          "value": "24.00"
        }
      ]
    },    
    {
      "eventType": "monetate:context:Purchase",
      "purchaseId": "123456789",
      "purchaseLines": 
      [        
        {
          "sku": "product72color2",
          "pid": "product72",
          "quantity": 2,
          "currency": "GBP",
          "value": "24.00"
        }
      ]
    },    
    {
      "eventType": "monetate:record:Impressions",
      "impressionIds": 
      [
        "2.MS4xLjE1MTQ4MDg5MDA"
      ]
    }
  ]
}

Objects

Device ID. Can be sent with new visitors without mt.v, but normally used for apps and similar where cookie IDs are not possible (targeting, conditioning).

"deviceId": "IMEI-123456789"

MT.V value. If this is not provided, one is returned and the session is considered as a new visitor for targeting and analytics.

"monetateId": "2.309132816.1519728587304"

Preview flag. If the session is a preview, include the token ID for this object for experience and split preview.

"preview": "6.3.eJyrVkpMTs4vzSuJz0xRsj..."

Unique customer ID for customer view and datasets.

"customerId": "87654321"

Channel (Monetate account information).

"channel": "a-76ca7dd3/p/example.com"

Events

The following objects are data passed to Monetate for experiences and analytics.

Decision request with possible filtering for certain action types, managed impressions, and to whether to include reporting in the response. The filters parameter can be used to filter certain action types.

{
  "eventType": "monetate:decision:DecisionRequest",
  "requestId": "12345678",
  "filters": 
  [
    "slot_name"
  ],
  "manageImpressions": false,
  "includeReporting": true
}

The IP address (for targeting and analytics).

{
  "eventType": "monetate:context:IpAddress",
  "ipAddress": "79.173.135.170"
}

Physical coordinates (for targeting and analytics).

{
  "eventType": "monetate:context:Coordinates",
  "latitude": "49.566667",
  "longitude": "10.883333"
}

User agent header (for targeting and analytics).

{
  "eventType": "monetate:context:UserAgent",
  "userAgent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en) AppleWebKit/522.11 (KHTML, like Gecko) Safari/3.0.2"
}

Screen size of the user (for targeting).

{
  "eventType": "monetate:context:ScreenSize",
  "width": 1024,
  "height": 762
}

Client-specific metadata (for targeting and conditioning).

{
  "eventType": "monetate:context:Metadata",
  "metadata": 
  {
    "language": "en-GB"
  }
}

Custom variables (for targeting).

{
  "eventType": "monetate:context:CustomVariables",
  "customVariables": 
  [    
    {
      "variable": "VariableName",
      "value": "VariableValue"
    }
  ]
}

Page view and type (for conditioning).

{
  "eventType": "monetate:context:PageView",
  "url": "https://www.example.com/search",
  "pageType": "search"
}

Referrer (for targeting and conditioning).

{
  "eventType": "monetate:context:Referrer",
  "referrer": "http://www.example.com"
}

Custom page events (for analytics).

{
  "eventType": "monetate:record:PageEvents",
  "pageEvents": 
  [
    "myEvent"
  ]
}

Search and PLP product view (for targeting and conditioning).

{
  "eventType": "monetate:context:ProductThumbnailView",
  "products": 
  [
    "product72",
    "product43",
    "product42"
  ]
}

PDP product view (for targeting and conditioning).

{
  "eventType": "monetate:context:ProductDetailView",
  "products": 
  [    
    {
      "productId": "product72",
      "sku": "product72-large-green"
    },    
    {
      "productId": "product43",
      "sku": "product43-medium-striped"
    },    
    {
      "productId": "product57"
    }
  ]
}

Cart (for targeting, conditioning, and analytics).

{
  "eventType": "monetate:context:Cart",
  "cartLines": 
  [    
    {
      "sku": "product72colour2",
      "pid": "product72",
      "quantity": 2,
      "currency": "GBP",
      "value": "24.00"
    }
  ]
}

Purchase (for targeting and analytics).

{
  "eventType": "monetate:context:Purchase",
  "purchaseId": "123456789",
  "purchaseLines": 
  [    
    {
      "sku": "product72colour2",
      "pid": "product72",
      "quantity": 2,
      "currency": "GBP",
      "value": "24.00"
    }
  ]
}

Impression record. When manageImpressions is set to true, this event tells Monetate that the impression happened.

{
  "eventType": "monetate:record:Impressions",
  "impressionIds": 
  [
    "2.MS4xLjE1MTQ4MDg5MDA"
  ]
}