Copy of Customer Data Platform: Appmiral integration
Imported from Guru. Original update on at 15:43:02 UTC
Introduction
Appmiral and the Customer Data Platform (CDP) are both CM.com products and are often used together by clients. An app is a great source of data, which can tell a lot about someone's interest and behavior. This data can then be used in the CDP to create personalized and relevant campaigns.
The Appmiral integration is often used in combination with sending push from the Mobile Marketing Cloud and using query parameters in Pages. For more information about this please check out the cards below:
Placeholder - MMC Push
Placeholder - Query parameters in Pages
Configure integration within Appmiral
First, we need to enable the integration, which is something that can only be done by the Appmiral team. To do so you need to contact David de Bels or Vincent de Smet and provide them a tenant ID and product token of the CDP account that you would like to connect.
To retrieve the tenant ID & product token:
Go the the CDP and select "Settings" in the menu on the left
Copy the tenant ID (make sure not to include the dot)
Create a product token and copy the token
Now, the Appmiral Team can use the Tenant ID & Product Token for the configuration in Notion.
Note: the greyed out text and the JSON with the Config file below is currently not needed for the setup
Secondly, you need to edit the config file within Appmiral. With the config file we can determine what information is being sent to the CDP.
The config file contains 42 fields which each indicate an activity type within the App. By setting a field to true, you're activating the connecting for this activity type. Setting it to false will deactivate the connection for that activity type. For an explanation of each activity type, please check the link below:
https://www.notion.so/Defined-Events-v2-619fc2d9d7f04516b5895a9074da7cfe
Please be aware that setting some activity types might cause a lot of traffic, which will affect the performace of the CDP. It is not recommended to activate views and clicks, since the data is in most cases not relevant and causes a lot of event being sent to the CDP.
An example of the config file can be found below. This config was used for the Dutch GP and is effective for customers with a lot of app users.
{
"account_login_failed": true,
"account_login_success": true,
"account_login_view": false,
"account_logout_success": true,
"album_detail_view": false,
"albums_view": false,
"artist_detail_view": false,
"artist_favourite_add": false,
"artist_favourite_remove": false,
"artists_view": false,
"calendar_view": false,
"card_tapped": false,
"lineup_view": false,
"menu_item_selected": false,
"menu_more_item_selected": false,
"menu_more_header_selected": false,
"menu_more_view": false,
"news_feed_view": false,
"performance_bookmark_add": false,
"performance_bookmark_remove": false,
"playlist_detail_view": false,
"playlists_view": false,
"poi_list_view": false,
"poi_selected": false,
"practical_view": false,
"profile_update": true,
"push_notification_opened": false,
"push_notification_received": false,
"region_on_enter": false,
"region_on_exit": false,
"reminder_notification_opened": false,
"schedule_view": false,
"search_view": false,
"settings_view": false,
"sponsor_selected": false,
"sponsors_view": false,
"static_map_view": false,
"terms_conditions_view": false,
"ticket_add_failed": false,
"ticket_add_success": true,
"tickets_view": false,
"web_link_view": false
}
You can follow the steps below to configure the adapter in the Appmiral CMS:
Login to Appmiral and go to the App of the customer that you'd like to enable the adapter for
Go to "Edition settings" in the menu on the left and click on "Edition config"
Scroll down until you see "CM.com CDP Events config"
Add your customized config JSON
Click "Save"
Configure integration within the CDP
Now that we've enabled and configured the integration on the Appmiral side, we need to configure it in the CDP.
First, we need to add "App User ID" as a profile property and make it a key. This will allow us to create profiles for app users of which we might not know an email address or phone number yet. Besides this, you might need to add some additional profile properties dependent on the use case, such as:
Favourite artists
Favourite performances
Push ID (is a key, and with external ID pushId)
Has push permission (boolean)
Has background location permission (boolean)
Has location permission (boolean)
Locale (standard in CDP)
App edition
App User ID (is key)
If you will also use the MMC to send out push messages, you need to add the profile property "Push ID" (make it a key property) and use the external key "PushId". By using the external key, the address book will recognize the push ID field so that it can be used in campaigns.
Moreover, you can create profile properties for top artists and perfomances, as this might be relevant for segmenting.
Note: currently, only the profile update event is being used in this integration. The “App: activity” and “App push notifications” event can be ignored
The Appmiral data will be sent to three event types in the CDP.
App: Activity
App: Profile update
App: Push notifications
To add the event types, scroll down to the header "Event types (JSON)", copy the JSON code and use it to create the event types in the customer's CDP. You can easly paste the JSON code by following the steps below:
Go to the Customer Data Platform and select "Raw sources" in the menu on the right
Scroll all the way down until you see a code block and then scroll futher down until you see "Mapping"
Click "New"
Add the JSON code in the code block
Click "Save"
After this, scroll down to the header "Scripts (JavaScript)" and "Mapping". Copy the code parts and add this in the right place for the right event types.
Regarding the mapping for the event type App: Activity, it is possible to map the email as well. However, be aware that email is being sent after a ticket had been added to the wallet. When doing this, you need to verify by filling in the email address which is used to personalize that ticket. This means, when you add a ticket that was personalized with another email address, the profiles of both will be merged in the CDP.
Use cases
Sessions
APP: ACTIVITY → Can be ignored for now!
{
"id": "1c013e00-2c70-44e2-818b-3e0b44dafe6d",
"isMain": false,
"name": "App: Activity",
"description": "-",
"properties": [
{
"id": "ef5ed814-912e-4009-97b9-d499d496c8bb",
"name": "App User ID",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"displayModel": {
"index": 1,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"8a2d3a14-338b-4d79-bc76-89513669637a"
],
"sourceProfileTypeIds": []
},
{
"id": "2f34e0bf-f79c-4361-9614-4e27984e8748",
"name": "Session key",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday"
],
"isKey": true,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"displayModel": {
"index": -1,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"8a2d3a14-338b-4d79-bc76-89513669637a"
],
"sourceProfileTypeIds": []
},
{
"id": "4b4da2a7-7eee-455f-a527-4c314a3cdd37",
"name": "Type",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"displayModel": {
"index": 2,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"8a2d3a14-338b-4d79-bc76-89513669637a"
],
"sourceProfileTypeIds": []
}
]
}
{
"account_login_failed": true,
"account_login_success": true,
"account_login_view": false,
"account_logout_success": true,
"album_detail_view": false,
"albums_view": false,
"artist_detail_view": false,
"artist_favourite_add": false,
"artist_favourite_remove": false,
"artists_view": false,
"calendar_view": false,
"card_tapped": false,
"lineup_view": false,
"menu_item_selected": false,
"menu_more_item_selected": false,
"menu_more_header_selected": false,
"menu_more_view": false,
"news_feed_view": false,
"performance_bookmark_add": false,
"performance_bookmark_remove": false,
"playlist_detail_view": false,
"playlists_view": false,
"poi_list_view": false,
"poi_selected": false,
"practical_view": false,
"profile_update": true,
"push_notification_opened": false,
"push_notification_received": false,
"region_on_enter": false,
"region_on_exit": false,
"reminder_notification_opened": false,
"schedule_view": false,
"search_view": false,
"settings_view": false,
"sponsor_selected": false,
"sponsors_view": false,
"static_map_view": false,
"terms_conditions_view": false,
"ticket_add_failed": false,
"ticket_add_success": true,
"tickets_view": false,
"web_link_view": false
}
APP: PROFILE UPDATE (S)
{
"id": "2de80098-db92-4533-a39f-1a472cfc7763",
"isMain": false,
"name": "App: Profile update (S)",
"description": "-",
"properties": [
{
"id": "5356cc0a-bb4c-4da8-9f06-0b5933216d58",
"name": "App edition",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 8,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "46e54e97-e0c0-41af-a1c5-ae99e3d17734",
"name": "App User ID",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 1,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "9fc1ac05-094b-4485-b7dd-e6b3555027d1",
"name": "App version",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 14,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "e9cdf570-918a-4230-aecc-7ebaf3e2cf5b",
"name": "CM.com push ID",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 3,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "9e935700-3aa4-4e38-ad73-12bb38421abc",
"name": "Email",
"type": "email",
"possibleOriginTypes": [
"email",
"string"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 6,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "cec07016-3b2e-48f3-8560-bb987ded8d2d",
"name": "Favourite artists",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 9,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "9d8fde22-8af4-4a7e-b9cc-5684b78d2f23",
"name": "Favourite performances",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 10,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "a63d999f-5c33-4904-8664-35dbac4d66d0",
"name": "First name",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 4,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "c363fcd0-8fed-4569-86e8-4999aa76eaf0",
"name": "Has background location permission",
"type": "boolean",
"possibleOriginTypes": [
"boolean",
"number"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 12,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "13816891-338d-49f5-bf81-79dca6cbd359",
"name": "Has email optin",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 15,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "b021ebd1-4ece-41ff-a6a1-b415eda92fca",
"name": "Has location permission",
"type": "boolean",
"possibleOriginTypes": [
"boolean",
"number"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 13,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "76ef1b98-aa6c-44ab-b141-56d80eb67464",
"name": "Has push permission",
"type": "boolean",
"possibleOriginTypes": [
"boolean",
"number"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 11,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "9d7cb252-f7a7-40c1-9063-b043cd959c77",
"name": "Last name",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 5,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "be1ce993-b2b7-4f0b-904f-1a1bc698f4a9",
"name": "Locale",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 16,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "e3776a52-ff9f-470d-8a7d-9620e9803b9f",
"name": "Mobile phonenumber",
"type": "phonenumber",
"possibleOriginTypes": [
"phonenumber",
"string"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 7,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "1e82dde5-3cbb-4a63-992b-79e70e9f9028",
"name": "Session key",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": true,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 0,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
},
{
"id": "820d0c6c-1df3-4847-ade9-62aa0c18a93c",
"name": "User ID",
"type": "string",
"possibleOriginTypes": [
"string",
"number",
"iso8601date",
"email",
"phonenumber",
"null",
"boolean",
"birthday",
"uri",
"currency",
"locale"
],
"isKey": false,
"externalKey": null,
"isNotIndexed": false,
"maxOccurences": null,
"isPII": false,
"addressBookFieldId": null,
"displayModel": {
"index": 2,
"isVisible": true
},
"operatorName": "",
"sourceEventTypeIds": [
"42c700f2-b868-47ef-949a-d0265384a987"
],
"sourceProfileTypeIds": []
}
],
"displayModel": null
}
Event types (JSON)
APP: Activity → Can be ignored for now!
{
"id": "8a2d3a14-338b-4d79-bc76-89513669637a",
"name": "App: Activity",
"properties": [
{
"id": "0427409b-485e-47ce-a48a-d6ec6d38828a",
"name": "App User ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "2bf6e800-ac39-4247-9010-3c2e514b73f8",
"name": "Artist ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "d2bf0fc2-a07f-47c2-b941-a721a0f07090",
"name": "Artist name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "602d1a20-7200-4e98-8901-e4674a3fc3cc",
"name": "Card ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "bdb7ad70-1e7f-4b0f-aa28-c85f8ebf80cb",
"name": "Card title",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "d07e2c4d-7fda-490f-b8cf-8573a845fc52",
"name": "Code",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "c2024a78-38c9-4325-92ad-1aecebe4d9ad",
"name": "DateOfEvent",
"priority": 0,
"type": "iso8601date",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "6b56335b-85c3-482d-86c2-00741382725e",
"name": "Email",
"priority": 0,
"type": "email",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "738c50ce-d21a-42cf-852c-88a8be9e363c",
"name": "Error",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "270e2a31-f7b8-4759-afa2-b1375a24fb88",
"name": "Item ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "c3346f06-7030-4357-b26c-cd498b030299",
"name": "Item name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "58e7c051-ff23-454c-b0a3-0db24586a563",
"name": "Item type",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "c1abdc25-0d7f-415d-a3db-b993c3453cc1",
"name": "Keyword",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "e700c3c4-ac74-4948-af83-ce50174ce500",
"name": "Menu item ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "ed66d5f0-59b4-4ab8-9b2e-019b7b9f6237",
"name": "Menu item name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "6711a85d-4463-48a7-855a-8edda9ee92f1",
"name": "Page ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "3dbb9a0a-0e28-4fea-850a-e4fbe863a29a",
"name": "Performance ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "afab2727-9128-460c-bcf3-59015c989f4d",
"name": "Performance name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "2a2fa7ba-4619-406c-ad84-3c051b2794c7",
"name": "POI ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "e4bdd291-3b50-424b-9f11-64a3c59ff2e7",
"name": "POI name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "817fb6c7-1687-44b8-9687-70d6c8fb90df",
"name": "Region ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "1c98815c-d2aa-4dba-a05c-596434369856",
"name": "Region name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "88979eae-5edd-4f0d-8089-abd3396018ca",
"name": "Session key",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "2beaa01c-674e-4e56-8d66-0f0b808bb245",
"name": "Sponsor ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "a10d858f-c4ed-4d36-a6f1-abc4a2dd08da",
"name": "Sponsor name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "f089a2b2-4add-4fce-a081-ba34b6aa9767",
"name": "Type",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "300066dc-5772-42c3-93c9-89e3c43855b3",
"name": "URL",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
}
]
}
APP: ACTIVITY (raw) → Can be ignored for now!
{
"id": "4dacf7af-6a36-41cf-aaad-baeda56ac9a1",
"name": "App: Activity (raw)",
"properties": []
}
APP: Profile update
{
"id": "42c700f2-b868-47ef-949a-d0265384a987",
"name": "App: Profile update",
"properties": [
{
"id": "43cc5273-b6e2-4fe3-b80c-c4e4e46fc5a2",
"name": "App edition",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "263c8027-0ca1-4eb2-9b10-4b83c101f2a6",
"name": "App User ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "8871d86d-25a5-4b12-8710-2ef7f06e07fd",
"name": "App version",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "0c4e01ad-6f7d-4e64-8fcc-ecb761f2dcde",
"name": "CM.com push ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "b4300d9c-deaa-41ed-873f-d61f79ecec96",
"name": "Created at",
"priority": 0,
"type": "iso8601date",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "1bcf1cad-f90c-47a9-b940-8609370a7c44",
"name": "Current edition",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "10715665-dd48-43a4-a293-59cba9009ceb",
"name": "Device resolution",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "43a4aaa6-45ef-48f1-9736-c89438be08aa",
"name": "Device type",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "31597273-f211-4e79-b264-a5751f81e963",
"name": "Email",
"priority": 0,
"type": "email",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "5b344659-6782-4799-b483-168b391b85f2",
"name": "Error",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "5be120ae-935f-4194-b209-23033291256b",
"name": "Favourite artists",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "ea529e40-afc5-4b66-8b8a-81a1d333d358",
"name": "Favourite artists ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "648c5956-bfbd-4ad6-bdf8-c728c6cfd73f",
"name": "Favourite locations",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "c1fb79a3-5811-4a95-9dca-d1e00fbfa4f7",
"name": "Favourite locations ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "82172735-cc47-443c-82cb-6589123c98e8",
"name": "Favourite performances",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "3e4e4eb3-c539-417c-9105-17aa95004411",
"name": "Favourite performances ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "0b594e7d-3ae4-4ef4-be73-fb3401d95038",
"name": "First name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "77e79922-1ed8-4a32-9808-5aed59f4f9e3",
"name": "Has background location permission",
"priority": 0,
"type": "boolean",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "737c5133-50f4-443a-8e1a-1ac693362d8e",
"name": "Has email optin",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "32d5c91b-a89f-4340-b258-876c40570a1a",
"name": "Has location permission",
"priority": 0,
"type": "boolean",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "2a1cf87e-f0df-433e-9c86-27e0bb5a3cf0",
"name": "Has phone optin",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "118cc284-8d90-4534-9412-c92f37d419bf",
"name": "Has push permission",
"priority": 0,
"type": "boolean",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "fcdbea6e-5097-47b1-a454-a31f30f893fa",
"name": "Last name",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "1a58c646-aef0-40de-9021-3f84ed93bd1e",
"name": "Locale",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "a447b670-88e9-47e0-8601-fb901eef3cad",
"name": "Login provider",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "2e330517-956d-4974-9d79-63466c32d7da",
"name": "Mobile phonenumber",
"priority": 0,
"type": "phonenumber",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "35b06ca1-b0a6-43ea-9952-b5c069c596e4",
"name": "Platform",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "c4739f3b-3648-4e3d-8651-cb8465f2aa25",
"name": "Push token",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "a875dcc8-50de-404a-b4f7-be1a02af3e81",
"name": "Session key",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "9fd1d9a6-7c2e-42c2-bf10-576f743466f5",
"name": "Type",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"id": "acf960c8-e8eb-4c2d-b445-144ef16570f1",
"name": "User ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
}
],
"displayModel": null
}
APP: Profile update (raw)
{
"id": "289fbb80-b04a-4991-a070-07587d7f4e11",
"name": "App: Profile update (raw)",
"properties": []
}
APP: Push notification → Can be ignored for now!
{
"id": "becc7aa2-b759-4075-b49a-75266775dd97",
"name": "App: Push notification",
"properties": [
{
"name": "App User ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"name": "DateOfEvent",
"priority": 0,
"type": "iso8601date",
"isOptional": true,
"isNotIndexed": false
},
{
"name": "Notification body",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"name": "Notification ID",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"name": "Notification title",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
},
{
"name": "Type",
"priority": 0,
"type": "string",
"isOptional": true,
"isNotIndexed": false
}
]
}
APP: PUSH NOTIFICATION (RAW) → Can be ignored for now!
{
"id": "e494a97c-513d-49d4-9c31-90af1e9fcba6",
"name": "App: Push notification (raw)",
"properties": []
}
Scripts (JavaScript)
App: Activity → Can be ignored for now!
function transform(inputEvent) {
var session_key = inputEvent.type + "-" + inputEvent.app_user_id;
emitEvent("8a2d3a14-338b-4d79-bc76-89513669637a", {
"App User ID": inputEvent.app_user_id,
"Session key": session_key,
"DateOfEvent": inputEvent.created_at,
"Type": inputEvent.type,
"Artist ID": inputEvent.artist_id,
"Artist name": inputEvent.artist_name,
"Performance ID": inputEvent.performance_id,
"Performance name": inputEvent.performance_name,
"Code": inputEvent.code,
"Email": inputEvent.email,
"Error": inputEvent.error,
"Menu item ID": inputEvent.menu_item_id,
"Menu item name": inputEvent.menu_item_name,
"Card ID": inputEvent.card_id,
"Card title": inputEvent.card_title,
"POI ID": inputEvent.poi_id,
"POI name": inputEvent.poi_name,
"Sponsor ID": inputEvent.sponsor_id,
"Sponsor name": inputEvent.sponsor_name,
"Page ID": inputEvent.page_id,
"Item ID": inputEvent.item_id,
"Item name": inputEvent.item_name,
"Item type": inputEvent.item_type,
"Region ID": inputEvent.region_id,
"Region name": inputEvent.region_name,
"URL": inputEvent.url,
"Keyword": inputEvent.keyword,
});
}
APP: profile update
function transform(inputEvent) {
// Helper functions
const truncateAndJoin = (arr = []) => arr.join(", ").slice(0, 1000);
const extractArrayData = (items = [], nameKey, idKey) => {
if (!items.length) return { names: '', ids: '' };
const names = items.map(item => item[nameKey] || item.artist_name);
const ids = items.map(item => item[idKey]);
return {
names: truncateAndJoin(names),
ids: truncateAndJoin(ids)
};
};
// Data extraction
const cm_push_id = inputEvent.push_cm_installation_id || inputEvent.cmpush_installation_id;
const {
names: favourite_artists_string,
ids: favourite_artists_id_string
} = extractArrayData(inputEvent.favorite_artists, 'artist_name', 'artist_id');
const {
names: performance_reminders_string,
ids: performance_reminders_id_string
} = extractArrayData(inputEvent.performance_reminders, 'performance_name', 'performance_id');
const {
names: favorite_locations_string,
ids: favorite_locations_id_string
} = extractArrayData(inputEvent.favorite_locations, 'poi_name', 'poi_id');
const user_id = inputEvent.account_user_id?.replaceAll("-", "");
const session_key = inputEvent.app_user_id;
// Main event emission
try {
emitEvent("42c700f2-b868-47ef-949a-d0265384a987", {
"Type": inputEvent.type,
"App User ID": inputEvent.app_user_id,
"Session key": session_key,
"Locale": inputEvent.locale,
"Platform": inputEvent.platform,
"Push token": inputEvent.push_token,
"CM.com push ID": cm_push_id,
"User ID": user_id,
"First name": inputEvent.account_user_first_name,
"Last name": inputEvent.account_user_last_name,
"Email": inputEvent.account_user_email,
"Mobile phonenumber": fixPhoneNumber(inputEvent.account_user_phone_number, "").phoneNumber,
"Login provider": inputEvent.account_login_provider,
"App version": inputEvent.app_version,
"App edition": inputEvent.selected_edition,
"Device type": inputEvent.device_type,
"Device resolution": inputEvent.device_resolution,
"Has email optin": inputEvent.account_user_email_opt_in,
"Has phone optin": inputEvent.account_user_phone_opt_in,
"Has push permission": inputEvent.has_push_permission,
"Has location permission": inputEvent.has_location_permission,
"Has background location permission": inputEvent.has_background_location_permission,
"Error": inputEvent.error,
"Favourite locations": favorite_locations_string,
"Favourite locations ID": favorite_locations_id_string,
"Favourite artists": favourite_artists_string,
"Favourite artists ID": favourite_artists_id_string,
"Favourite performances": performance_reminders_string,
"Favourite performances ID": performance_reminders_id_string,
"Created at": inputEvent.created_at,
});
// Handle email consent events
if (inputEvent.account_user_email) {
const consentEvent = {
"ConsentLocation": "Appmiral App",
"ConsentValue": inputEvent.account_user_email_opt_in === "yes",
"Email": inputEvent.account_user_email,
"DateOfEvent": inputEvent.created_at,
"ConsentText": "I agree to receive communication by email used for marketing purposes by the event organizer"
};
emitEvent("e17fb62f-4f6e-44b7-92b4-8f85ce3b609c", consentEvent);
}
} catch (error) {
console.error('Error in transform function:', error);
throw error;
}
}
App: Push notification→ Can be ignored for now!
function transform(inputEvent) {
emitEvent("becc7aa2-b759-4075-b49a-75266775dd97", {
"App User ID": inputEvent.app_user_id,
"DateOfEvent": inputEvent.created_at,
"Type": inputEvent.type,
"Notification ID": inputEvent.notification_id,
"Notification title": inputEvent.notification_title,
"Notification body": inputEvent.notification_body,
});
}
Mapping
App: activity -> Session → Can be ignored for now!
App User ID -> App User ID
Session key -> Session key
Type -> Type
App: activity -> Profile → Can be ignored for now!
App User ID -> App User ID
App: Profile update -> Session
App User ID -> App User ID
App edition -> App edition
CM.com push ID -> CM.com push ID
Email -> Email
Favourite artists -> Favourite artists
Favourite performances -> Favourite performances
First name -> First name
Has background location permission -> Has background location permission
Has email optin -> Has email optin
Has location permission -> Has location permission
Has push permission -> Has push permission
Last name -> Last name
Locale -> Locale
Mobile phonenumber -> Mobile phonenumber
Session key -> Session key
User ID -> User ID
App: Profile update (S) -> Profile
App User ID -> App User ID
Email -> Email
Favourite artists -> Favourite artists
Favourite performances -> Favourite performances
First name -> First name
Has background location permission -> Has background location permission
Has location permission -> Has location permission
Has push permission -> Has push permission
Last name -> Last name
Locale -> Locale
CM.com push ID -> Push ID
App edition -> App edition
App: Push notification -> Profile → Can be ignored for now!
App User ID -> App User ID