Skip to content

Email

Handles attribution and interaction tracking for Segmentify email campaigns.

View as Markdown llms.txt

Handles attribution and interaction tracking for Segmentify email campaigns. These events must be sent when a user arrives on your site via an email campaign link where utm_medium=email.

Before sending any of these events, verify that the campaign URL contains the required UTM parameters: utm_source=segmentify, utm_medium=email, utm_campaign=eml_xxxx, and utm_code=xxxxxxxx.

Requests:

  • Email View — fires when the user lands on the site from an email link. Uses type: "email" and sets both instanceId and interactionId to {emailCampaignId} (the utm_campaign value).
  • Email Click — fires when the user clicks a product or recommendation shown as a result of the email campaign. Uses type: "click" with instanceId set to the campaign ID and interactionId set to the clicked {productId}.
  • Email User Op — identifies the arriving user by linking their session to a known email identity. Uses name: "USER_OPERATIONS", step: "identify", channel: "email", and identity: {utm_code} (the hash from the campaign URL).

Send this event when a user opens or views an email sent by a Segmentify email campaign. This event must be fired as soon as the user lands on your website via an email campaign link where utm_medium=email.

⚠️ Important: Before sending this event, make sure the email campaign URL contains the following UTM parameters:


POST https://{dataCenterUrl}.segmentify.com/add/events/v1.json?apiKey={apikey}


Field Type Required Description
name string ✅ Event name. Must be INTERACTION.
userId string ✅ Unique identifier for the user.
sessionId string ✅ Unique identifier for the current session.
testMode string ✅ Set to "false" for production events.
device string ✅ Device type of the user (e.g., DESKTOP, MOBILE, TABLET).
lang string ✅ Language code (e.g., en, tr).
currency string ✅ Currency code (e.g., USD, EUR, TRY).
region string ❌ Region or country code of the user.
email string ✅ Email address of the user who received the campaign.
type string ✅ Interaction type. Fixed value: "email".
interactionId string ✅ The email campaign ID. Use the utm_campaign value from the email link. Maps to {emailCampaignId}.
instanceId string ✅ The email campaign instance ID. Same as interactionId. Maps to {emailCampaignId}.

Example body

{
"name": "INTERACTION",
"userId": "1234567890123456789",
"sessionId": "9876543210987654321",
"testMode": "false",
"device": "PC",
"lang": "EN",
"currency": "EUR",
"region": "",
"email": "user@example.com",
"type": "email",
"interactionId": "eml_xxxx",
"instanceId": "eml_xxxx"
}

Send this event when a user clicks on a product or recommendation within a Segmentify email campaign. This event tracks which products the user interacted with after arriving from an email link where utm_medium=email.

⚠️ Important: Before sending this event, make sure the email campaign URL contains the following UTM parameters:

  • utm_source=segmentify
  • utm_medium=email
  • utm_campaign=eml_xxxx
  • utm_code=xxxxxxxx

POST https://{dataCenterUrl}.segmentify.com/add/events/v1.json?apiKey={apikey}


Field Type Required Description
name string ✅ Event name. Must be INTERACTION.
userId string ✅ Unique identifier for the user.
sessionId string ✅ Unique identifier for the current session.
testMode string ✅ Set to "false" for production events.
device string ✅ Device type (e.g., DESKTOP, MOBILE, TABLET).
params object ❌ Additional custom parameters. Can be left empty {}.
recommendIds array ❌ IDs of recommendations shown in the email.
pageUrl string ❌ Full URL of the page the user landed on after clicking.
referrer string ❌ URL of the referring page.
lang string ✅ Language code (e.g., en, tr).
currency string ✅ Currency code (e.g., USD, EUR, TRY).
region string ❌ Region or country code of the user.
type string ✅ Interaction type. Fixed value: "click".
instanceId string ✅ The email campaign ID. Maps to {emailCampaignId}.
interactionId string ✅ The ID of the product that was clicked in the email. Maps to {productId}.
email string ✅ Email address of the user who received the campaign.

Example body

{
"name": "INTERACTION",
"userId": "1234567890123456789",
"sessionId": "9876543210987654321",
"testMode": "false",
"device": "PC",
"params": {},
"recommendIds": [],
"pageUrl": "",
"referrer": "",
"lang": "EN",
"currency": "EUR",
"region": "",
"type": "click",
"instanceId": "eml_xxxx",
"interactionId": "PRODUCT_ID",
"email": "user@example.com"
}

Send this event to identify the user who arrived via a Segmentify email campaign link. This event links the anonymous user session to a known email identity using the utm_code hash from the campaign URL. It must be fired when utm_medium=email is detected in the URL.

⚠️ Important: The identity field must be populated with the utm_code value from the email campaign URL. This is a unique hash that Segmentify uses to identify the recipient.

Example URL parameter: utm_code=UTM_CODE_HASH


POST https://{dataCenterUrl}.segmentify.com/add/events/v1.json?apiKey={apikey}


Field Type Required Description
name string ✅ Event name. Must be USER_OPERATIONS.
userId string ✅ Unique identifier for the user.
sessionId string ✅ Unique identifier for the current session.
device string ✅ Device type (e.g., DESKTOP, MOBILE, TABLET).
lang string ✅ Language code (e.g., en, tr).
currency string ✅ Currency code (e.g., USD, EUR, TRY).
region string ❌ Region or country code of the user.
email string ❌ Email address of the user (if known at this point).
step string ✅ Operation step. Fixed value: "identify".
channel string ✅ The channel through which the user arrived. Fixed value: "email".
type string ✅ Identity type. Fixed value: "sgm-hash".
identity string ✅ The utm_code hash value extracted from the email campaign URL. Maps to {utm_code}.

Example body

{
"name": "USER_OPERATIONS",
"userId": "1234567890123456789",
"sessionId": "9876543210987654321",
"device": "PC",
"domain": "https://www.example.com",
"lang": "EN",
"email": "",
"step": "identify",
"channel": "email",
"type": "sgm-hash",
"identity": "UTM_CODE_HASH"
}