Skip to main content

Introduction

With MoEngage Event Exports, you can forward events to various third-party tools. We offer the following capabilities:
  1. MoEngage Streams - Streams allow you to forward events like user actions, campaign interaction events, and so on available in MoEngage to a pre-defined API endpoint in near real-time.
  2. Data Warehouses - MoEngage supports multiple data warehouses as destinations to forward events directly to your tables. We support:
    1. Amazon Redshift
    2. Google BigQuery (via GCS)
    3. Snowflake
  3. Cloud Storages - MoEngage also supports multiple cloud storages as destinations to forward events as JSON files in your buckets.
    1. Amazon S3
    2. Google Cloud Storages
    3. SFTP

Export Schema

The export schema depends on the type of destination. Each category (Data Warehouse, Cloud Storages, APIs) has a consistent schema to account for various MoEngage Events and User-Defined Events.

Streams (API)

MoEngage will make a Bulk API call to your provided API Endpoint. Here is the generic structure: JSON
{
  "app_name": "The name of your app.",
  "source": "MOENGAGE",
  "moe_request_id": "MoEngage unique request id for each request.",
  "events": [
    {
      "event_name": "Name of your event",
      "event_code": "Event code",
      "event_uuid": "Unique code of this event. This helps in determining each unique event being captured by MoEngage.",
      "event_time": "EPOCH_TIMESTAMP_OF_EVENT_TRIGGERED_TIME_IN_UTC",
      "event_type": "CAMPAIGN_EVENT",
      "event_source": "MOENGAGE",
      "push_id": "Recipient device’s push token",
      "email_id": "Recipient's email ID",
      "mobile_number": "Recipient's mobile number",
      "uid": "MoEngage Customer ID",
      "event_attributes": {
        "campaign_id": "ID of the campaign",
        "campaign_name": "Name of the campaign",
        "campaign_type": "Type of the campaign",
        "campaign_channel": "Channel of the campaign"
      },
      "user_attributes": {
        "moengage_user_id": "MoEngage Internal User ID"
      },
      "device_attributes": {
        "moengage_device_id": "MoEngage Device ID"
      }
    }
  ]
}

Schema

Key NameDescription
app_nameThe name of your app on MoEngage.
sourceThe source from which this event was captured.
moe_request_idUnique MoEngage API Request ID.
eventsEvents object array.

Event Object Schema

Key NameDescription
event_nameThe display name of the event.
event_codeThe event code or the internal name of the event.
event_uuidUnique code of the event that was captured.
event_timeThe epoch timestamp when the event was captured.
event_typeThe type of event:
  • ACQUISITION
  • CAMPAIGN_ACTIVITY
  • LIFECYCLE
  • REACHABILITY
  • UNINSTALL
  • USER_ACTION_EVENT
sourceThe source from which this event was captured.
push_idThe recipient’s device push token. This attribute will only be sent for PUSH-related Campaign Events.
email_idThe recipient’s email ID. This attribute will only be sent for EMAIL-related Campaign Events.
mobile_numberThe recipient’s mobile number. This attribute will only be sent for SMS-related Campaign Events.
uidMoEngage customer_id to uniquely identify a user in MoEngage.
event_attributesEvent attributes object in this format:
attribute_name: value
user_attributesUser attributes object in this format:
attribute_name: value
device_attributesDevice attributes object in this format:
attribute_name: value

Event Attributes Object

The event attributes might vary according to the event being exported. Refer to the event definitions below to see which attributes are exported.

User Attributes Object

The user attributes might vary according to your configuration. Refer to the user properties definitions below to see which attributes are exported.
  • moengage_user_id - This attribute is always exported. This is the internal MoEngage ID of your user.

Device Attributes Object

The device attributes might vary according to your configuration. Refer to the device properties definitions below to see which attributes are exported.
  • moengage_device_id - This attribute is always exported. This is the internal Device ID of your user.

Data Warehouses Destinations

MoEngage will create a single table in your Data warehouse and export all your selected events to that table.

Amazon Redshift

We will create a table called moengage_events.

Snowflake

We will create a table called moe_events_<table_creation_timestamp>.

Table Structure

The overall structure of the table will remain fixed for all types of events. Any new user property or event attribute that is exported will be part of the user_attributes or event_attributes column respectively. All the events will be dumped in a single table containing all necessary information such as event names, event times, etc for easy analysis. We follow the below generic schema:
  • Any column beginning with event_attributes_ contains an event attribute. This will be followed by the event attribute name like event_attributes_campaign_name.
  • Any column beginning with user_attributes_ contains a user attribute. This will be followed by the user attribute name like user_attributes_moengage_user_id.
  • Any column beginning with device_attributes contains a device attribute. This will be followed by the device attribute name like device_attributes_moengage_device_id.
  • We also have three JSON (or equivalent) fields called event_attributes, user_attributes, and device_attributes. Each of these fields contains raw JSON fields in the form of a dictionary.
Key NameTypeDescriptionNULL
app_namecharacter varying(256)The name of your app on MoEngage.NOT NULL
device_attributesEither of:
  • super
  • variant
Device attributes dictionary in JSON object format:
JSON
{
"attribute": "value",
"attribute": "value"
}
NULL
device_attributes_ moengage_device_idcharacter varying(256)This is the internal Device ID of your user.NULL
email_addresscharacter varying(256)The recipient’s email ID. This attribute will only be sent for EMAIL-related Campaign Events.NULL
event_attributesEither of:
  • super
  • variant
Event attributes dictionary in JSON object format:
JSON
{
"attribute": "value",
"attribute": "value"
}
NULL
event_attributes_ app_versioncharacter varying(256)Refer to common event attributes.NULL
event_attributes_ campaign_channelcharacter varying(256)Refer to common event attributes of campaign-related events.NULL
event_attributes_ campaign_idcharacter varying(256)Refer to common event attributes of campaign-related events.NULL
event_attributes_ campaign_namecharacter varying(256)Refer to common event attributes of campaign-related events.NULL
event_attributes_ campaign_typecharacter varying(256)Refer to common event attributes of campaign-related events.NULL
event_attributes_ first_sessionbooleanRefer to common event attributes.NULL
event_attributes_ locale_idcharacter varying(256)Tracked when the campaign is sent using Localization. Represents the id of the message locale.NULL
event_attributes_ locale_namecharacter varying(256)Tracked when the campaign is sent using Localization. Represents the name of the message locale.NULL
event_attributes_ logged_in_statuscharacter varying(256)Refer to common event attributes.NULL
event_attributes_ parent_campaign_idcharacter varying(256)Refer to common event attributes of campaign-related events.NULL
event_attributes_ parent_flow_idcharacter varying(256)The flow ID. Refer to common event attributes of campaign-related events.NULL
event_attributes_ parent_flow_namecharacter varying(256)The name of the flow. Refer to common event attributes of campaign-related events.NULL
event_attributes_ platformcharacter varying(256)Refer to common event attributes.NULL
event_attributes_ readable_campaign_idcharacter varying(256)Refer to common event attributes of campaign-related events.NULL
event_attributes_ sdk_versioncharacter varying(256)Refer to common event attributes.NULL
event_attributes_ timestampEither of: - bigint - timestamp_ntzRefer to common event attributes.NULL
event_attributes_ urlcharacter varying(256)Tracked when display filter is selected in the in-app campaign.NULL
event_attributes_ variation_idcharacter varying(256)Represents the id of message variation. Refer to common event attributes of campaign-related events.NULL
event_codecharacter varying(256)The event code or the internal name of the event.NOT NULL
event_namecharacter varying(256)The display name of the event.NOT NULL
event_sourcecharacter varying(256)The source from which this event was captured.NOT NULL
event_timeEither of:
  • bigint
  • timestamp_ntz
The epoch timestamp when the event was captured.NOT NULL
event_typecharacter varying(256)The type of event: - ACQUISITION - CAMPAIGN_ACTIVITY - LIFECYCLE - REACHABILITY - UNINSTALL - USER_ACTION_EVENTNOT NULL
event_uuidcharacter varying(256)Unique code of the event that was captured.NOT NULL
mobile_numbercharacter varying(256)The recipient’s mobile number. This attribute will only be sent for SMS-related Campaign Events.NULL
push_idcharacter varying(256)The recipient’s device push token. This attribute will only be sent for push-related Campaign Events.NULL
uidcharacter varying(256)MoEngage customer_id to uniquely identify a user in MoEngage.NULL
user_attributesEither of:
  • super
  • variant
User attributes dictionary in JSON object format:
JSON
{
"attribute": "value",
"attribute": "value"
}
NULL
user_attributes_ moengage_user_idcharacter varying(256)This is the internal MoEngage ID of your user.NULL

Google BigQuery (Generic)

MoEngage exports events to your BigQuery tables via GCS Buckets using the BigQuery Transfer File service. There are two ways you can create a table for your events in BigQuery:
  1. Create a table specific to your exported events by using the schema of your exported files.
  2. Create a table that has a generic schema.
If you want to create a generic schema and are unsure of your events, you can use this schema: JSON
[
    {
        "mode": "NULLABLE",
        "name": "db_name",
        "type": "STRING"
    },
    {
        "mode": "NULLABLE",
        "name": "export_hour",
        "type": "INTEGER"
    },
    {
        "mode": "NULLABLE",
        "name": "export_day",
        "type": "DATE"
    },
    {
        "mode": "NULLABLE",
        "name": "event",
        "type": "JSON"
    },
    {
        "mode": "NULLABLE",
        "name": "app_name",
        "type": "STRING"
    },
    {
        "mode": "NULLABLE",
        "name": "export_doc_id",
        "type": "STRING"
    }
]

Cloud Storages Destinations

MoEngage will export compressed files to your cloud storage.

Generic Export Schema

  • File format: .json.gz
  • Each uncompressed file will have newline-delimited events in JSON format (each line is a single event).
  • Each file can have multiple types of events in them. We don’t create a single file for each type of event.
  • The event JSON format is described below:
JSON
{
    "app_name": "export_sample_files",
    "export_hour": "13",
    "export_doc_id": "63a186ac116xxxxb254fbb23",
    "db_name": "export_sample_files",
    "event": {
        "email_id": "john.doe@example.com",
        "uid": "user1",
        "event_type": "CAMPAIGN_EVENT",
        "event_code": "MOE_EMAIL_SENT",
        "event_name": "Email Sent",
        "user_attributes": {
            "moengage_user_id": "6387301exxxxxx6c828aee2c"
        },
        "event_source": "MOENGAGE",
        "event_attributes": {
            "campaign_name": "Test email1",
            "campaign_type": "GENERAL",
            "moe_campaign_channel": "Email",
            "moe_delivery_type": "One Time",
            "campaign_id": "63918ad73bbxxxxxxb728ede",
            "campaign_channel": "EMAIL"
        },
        "event_uuid": "ffbxxedc-4eb8-xxxx-xxxx-a0c87eaxxxxx",
        "event_time": 1668600246,
        "device_attributes": {
            "moengage_device_id": "test_device_id"
        }
    },
    "export_day": "2022-12-21"
}

Schema

Key NameDescription
app_nameThe name of your app on MoEngage.
export_hourThe hour at which the export was created.
export_doc_idThe document ID of the export.
db_nameThe name of your app on MoEngage.
export_dayThe day on which the export was created.
eventEvent object.

Event Object Schema

Key NameDescription
event_nameThe display name of the event.
event_codeThe event code or the internal name of the event.
event_uuidUnique code of the event that was captured.
event_timeThe epoch timestamp when the event was captured.
event_typeThe type of event:
  • ACQUISITION
  • CAMPAIGN_ACTIVITY
  • LIFECYCLE
  • REACHABILITY
  • UNINSTALL
  • USER_ACTION_EVENT
event_sourceThe source from which this event was captured.
push_idThe recipient’s device push token. This attribute will only be sent for PUSH-related Campaign Events.
email_idThe recipient’s email ID. This attribute will only be sent for EMAIL-related Campaign Events.
mobile_numberThe recipient’s mobile number. This attribute will only be sent for SMS-related Campaign Events.
uidMoEngage customer_id to uniquely identify a user in MoEngage.
event_attributesEvent attributes dictionary in this format: attribute_name: value
user_attributesUser attributes dictionary in this format: attribute_name: value
device_attributesDevice attributes dictionary in this format: attribute_name: value

Event Attributes Object

The event attributes might vary according to the event being exported. Refer to the event definitions below to see which attributes are exported.

User Attributes Object

The user attributes might vary according to your configuration. Refer to the user properties definitions below to see which attributes are exported.
  • moengage_user_id - This attribute is always exported. This is the internal MoEngage ID of your user.

Device Attributes Object

The device attributes might vary according to your configuration. Refer to the device properties definitions below to see which attributes are exported.
  • moengage_device_id - This attribute is always exported. This is the internal Device ID of your user.

Amazon S3

MoEngage will create a pre-defined file path inside the folder you specify while setting up the S3 Exports. We will dump files in the following locations: s3://<your_bucket_name>/[<folder_path>_]<connection_name>/export_day=<DD-MM-YYYY>/event_exports_<export_timestamp>.json.gz

Google Cloud Storage

MoEngage will create a pre-defined file path in your GCS Bucket. We will dump files in the following locations: gs://<your_bucket_name>/event-exports/<your_app_name>/<connection_id>/export_day=YYYY-MM-DD/export_hour=HH/<file-name>.json.gz

SFTP

MoEngage will create a pre-defined file path on your SFTP Server. We will dump files in the following locations: sftp://<your_host_name>/[<folder_path>/]<connection_name>/export_day=<DD-MM-YYYY>/event_exports_<export_timestamp>.json.gz

Events Exported

All MoEngage-tracked attributes start with moe_.

User Attributes

Key NameAttribute KeyDescription
First Seencr_tcr_tFirst seen time of the user. The time when the user is created in MoEngage systems.
LTVt_revLife Time Value of the user. This is the total sum of revenue attributes present in the App Conversion Goal event performed by a user. LTV is updated every time the app conversion goal event is executed by the user.
Last Seenu_l_aThe time of the most recent App/Site Open event for the user.
No. of Conversionst_transNo. of conversion events done by the user, Conversion Goal can be modified on the settings page.
No. of Sessionsu_s_cNo.of sessions done by the user. This is the number of times a user has performed the App/Site Open event.

Device Attributes

These are properties derived from your users’ device data. Note that these attributes will still be shown under user attributes in your exports.
Key NameAttribute KeyDescriptionOptional
Advertising Identifier (iOS & Windows)ADVERTISING_IDENTIFIERAn alphanumeric string unique to each device used only for serving advertisements) - IDFA iOS version 14.5 and above Advertisement identifier will be tracked only if the developer asked permission for it. Below iOS 14.5 it is tracked automatically.Yes
IDFVdevice_IDFVAn alphanumeric string that uniquely identifies a device to the app’s vendor - IDFV (identifier for vendor)Yes
OS Versionos_verCurrent iOS version of the deviceNo
Device Timezonemoe_dtzoDevice TimezoneNo
modelMODELNo

MoEngage (Standard) Events

MoEngage, by default, tracks a few standard events.

Common Event Attributes

These attributes are automatically tracked when MoEngage captures a standard event.
Key NameAttribute KeyDescription
App VersionappVersionApp version on which this event was tracked.
SDK VersionsdkVersionMoEngage SDK version on which this event was tracked.
PlatformosOS on which this event was tracked.
utm_sourcemoe_sourceSource of a campaign e.g. search engine, newsletter, MoEngage.
utm_mediummoe_source_mediumMedium of a campaign e.g. CPC, email, push.
utm_campaignmoe_source_campaign_nameUTM Campaign name e.g. Summer sale
utm_idmoe_source_campaign_idUTM campaign ID e.g. 12DSW55
utm_contentmoe_source_contentContent information of the campaign e.g. logoclick
utm_termmoe_source_termTerm used for paid search e.g. red+shirt
First Sessionmoe_first_visit
  • Generated for all the events tracked with MoEngage web SDK.
  • Value is True for the first session of the user only.
Logged In Statusmoe_logged_in_status
  • Generated for all the events tracked with MoEngage web SDK.
  • Value is True if the user has logged in on the device.

Standard Events

These events are automatically tracked with MoEngage.
Event NameEvent CodeDescriptionPlatform
App/Site OpenedMOE_APP_OPENEDTracked when a user session begins on the app or website. Also, this is tracked only if the time difference between the user’s Last Active Time and App/Site Open Time is more than 30 min.Android, iOS, Web
Viewed Web PageMOE_PAGE_VIEWEDTracked when a user visits a web page. Select page URL as an event attribute to find the number of users visiting a particular page or use it to set up a Drop-off capture” Event-Triggered Web Push.Web
App ExitMOE_APP_EXITTracked whenever the App goes to background.Android, iOS
User LogoutMOE_LOGOUTTracked when a user Logs out of the app/site or user reset.Android, iOS, Web
Push ID Register AndroidTOKEN_EVENTTracked when the MoEngage system registers the push ID for Android devices. Attribute registered_by has the status.Android
User MergedMOE_USER_MERGEDTracked for a known user whenever a MoEngage user object is merged with it.User Merging
App UpdateUPDATETracked when a user updates the App.Android, iOS

User-Defined (Custom) Events

Common Event Attributes

These attributes are automatically tracked when you track a custom/user-defined event.
Key NameAttribute KeyDescription
App VersionappVersionApp version on which this event was tracked.
SDK VersionsdkVersionMoEngage SDK version on which this event was tracked.
MOE Event Categorymoe_event_categoryRepresents the Event category
- Example: Tracked User Events
MOE Event Sourcemoe_event_sourceRepresents the Event Source
- Example: s2s, INTERNAL