{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Real Time Omnichannel Personalization with mParticle\n",
"\n",
"This module uses Amazon Personalize to generate and associate personalized product recommendations for users then execute an omnichannel personalization campaign using mParticle. \n",
"\n",
"Estimated time: 30 minutes\n",
"\n",
"## Prerequisites\n",
"\n",
"In order to complete this workshop, you will need to complete the 1.1-Personalize workbook in this directory. You will also need a mParticle workspace. If you are doing this workshop as part of a live workshop event, ask your moderator how to set up a mParticle workspace. If you are running this workshop on your own, you can sign up for a free trial (https://www.mparticle.com/free-trial) to request for the creation of a mParticle account. We do not recommend using your production mParticle workspace for this workshop.\n",
"\n",
"## mParticle Platform Overview\n",
"mParticle is a customer data platform (CDP) that helps you collect, clean, and control your customer data. mParticle provides several types of Sources which you can use to collect your data, and which you can choose from based on the needs of your app or site. For websites, you can use a javascript library to collect data. If you have a mobile app, you can embed one of mParticle’s Mobile SDKs, and if you’d like to create messages directly on a server (if you have, for example a dedicated .NET server that processes payments), mParticle has several server-based libraries that you can embed directly into your backend code. With mParticle, you can also use cloud-sources to import data about your app or site from other tools like Zendesk or Salesforce, to enrich the data sent through mParticle. By using mParticle to decouple data collection from data use, you can create a centralized data supply chain based on organized and modular data.\n",
"\n",
"
\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup\n",
"\n",
"For this exercise, we are going to integrate Braze with mParticle using the Braze Partner-Kit (https://github.com/mparticle-integrations/mparticle-javascript-integration-appboy) such that we can showcase how a CDP can simplify and lessen the development effort across the different downstream systems that you are planning to integrate with mParticle.\n",
"\n",
"mParticle provides a variety of partner-kits (https://github.com/mparticle-integrations). These partner-kits allows mParticle to abstract the data collection from your source application and automatically instrument or forward it to the integrated systems with mParticle without the need of writing the 3rd party's vendor SDK. Through this approach, you as a developer will only require to include the partner-kits within your project and only write a single line of code using the mParticle Web/iOS/Android/etc.. SDK.\n",
"\n",
"### Integrate mParticle with Braze using the mParticle Braze Connector\n",
"\n",
"To understand more about the mParticle Braze Connector, you can visit here - https://www.mparticle.com/integration/braze\n",
"\n",
"For a detailed documentation of the end-to-end setup guide, please go here https://docs.mparticle.com/integrations/braze/audience/\n",
"\n",
"### Configure mParticle to forward Events and User Attributes to Braze\n",
"\n",
"Navigate to Directory on the left-hand navigation bar and search for Braze\n",
"\n",
"
\n",
"\n",
"Click Setup. Select and Tick Output Event and click configure.\n",
"\n",
"
\n",
"\n",
"The API key here will come from Braze dashboard-> Settings -> Developer Console\n",
"\n",
"You can create a dummy Web app and from there it will generate a key. The API key there is the key to be entered above.\n",
"\n",
"
\n",
"Once that's done, lets connect the Retail Demo Store App with Braze by clicking 'Connections' in the left-hand side navigation bar .\n",
"\n",
"
\n",
"Select and Click the JS Web Platform as the Input\n",
"\n",
"
\n",
"\n",
"Select and Click Braze as the Output.\n",
"\n",
"
\n",
"\n",
"The App Group REST API KEY can be found in Braze by going the the Dashboard-> App Settings-> Developer Console.\n",
"\n",
"You would need to issue a new key as part of the process. The key created will be the key to be used in the section mentioned above.\n",
"\n",
"
\n",
"You have successfully completed configuring mParticle to forward and orchestrate events to Braze.\n",
"\n",
"### Configure mParticle to forward Audiences to Braze\n",
"\n",
"Navigate to Directory on the left-hand navigation bar and search for Braze\n",
"\n",
"
\n",
"Click Setup. Select and Tick Output Audience and click configure.\n",
"\n",
"
\n",
"\n",
"The API Key and the App Group REST API KEY can be found in Braze by going the the Dashboard-> App Settings-> Developer Console.\n",
"\n",
"\n",
"
\n",
"\n",
"\n",
"You have successfully completed configuring mParticle to forward and orchestrate audiences and its member to Braze.\n",
"\n",
"### Create Audience in mParticle and connect it to Braze\n",
"\n",
"To create an audience in mParticle, Click Audiences on the left-hand side navigation bar.\n",
"\n",
"
\n",
"\n",
"Click the + button to create a new audience.\n",
"\n",
"Provide an Audience name, external name and select Web under your active Workspace where the Retail Demo Store is currently configured upon.\n",
"\n",
"
\n",
"\n",
"mParticle provides its end user a WYSIWYG Audience Builder wherein any user can create an Audience using a IF-THEN-ELSE-IF Rule\n",
"\n",
"
\n",
"
\n",
"
\n",
"\n",
"Click Activate. mParticle provides a light-weight A/B Testing capability but for this workshop, we will skip this part. You should get the following screen. Click No, take me to connect.\n",
"\n",
"
\n",
"\n",
"
\n",
"\n",
"Click + Connect Output. Select Braze and Click Save.\n",
"\n",
"\n",
"
\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Create a Calculated Attribute in mParticle\n",
"\n",
"A Calculated Attribute (CA) is a read-only value about a single user, providing granular insight into user behavior. These attributes are defined in mParticle and are computed automatically over time by using the raw data stream of events and user information.\n",
"\n",
"Calculated Attributes (https://docs.mparticle.com/guides/platform-guide/calculated-attributes/):\n",
"\n",
" Enable personalized campaigns and targeting with an always-on understanding of the customer behavior\n",
" Help Marketers, Product Managers and Data Scientists better understand customer behavior and interactions with their brand\n",
" Standardize the calculated values across the entire marketing and analytics stack, across platforms and tools\n",
"\n",
"
\n",
"\n",
"Let's create a calculated Attribute in mParticle that will calculate the Customer's Life Time Value (LTV) by aggregating all of the customer's purchase done over a period of time.\n",
"\n",
"\n",
"
\n",
"\n",
"Select Aggregation as the Category.\n",
"\n",
"
\n",
"\n",
"Select Sum as the Calculation Type. Select Commerce Events->Product Actions->Purchase. Select Total Amount as the Attribute. Click Save.\n",
"\n",
"Select last 60 days in the date range.\n",
"\n",
"
\n",
"\n",
"\n",
"Click Activate.\n",
"\n",
"## View the customer profile within mParticle via User Activity View\n",
"\n",
"Navigate to Activity and click User Activity in the left-hand side navigation bar.\n",
"\n",
"Enter the email address of the user you've currently logged in the Retail Demo Store and select Email Address on the filter field.\n",
"\n",
"You should be provided of the 360 degree view profile of the customer on-hand. mParticle's User Activity View will show all the information mParticle has captured from the different sources where mParticle is tracking data upon.\n",
"\n",
"Such data are:\n",
"\n",
" User Identifiers\n",
" Device Attributes\n",
" User Attributes\n",
" Audience Memberships\n",
"\n",
"\n",
"
\n",
"
\n",
"
\n",
"\n",
"\n",
"## View the syndicated data in Braze\n",
"\n",
"Login to Braze, click User Search and search for the user's email which is currently logged in the Retail Demo Store.\n",
"\n",
"
\n",
"\n",
"
\n",
"\n",
"\n",
"Once defined, mParticle will syndicate your Event, User Attribute and audiences with each tool and dynamically. For reference, if you wanted to synchronize the end tools we discussed, you can follow this documentation:\n",
"\n",
"- Braze: https://docs.mparticle.com/integrations/braze/\n",
"- Google Ads: https://docs.mparticle.com/integrations/google-ads/\n",
"- Facebook Ads: https://docs.mparticle.com/integrations/facebook/\n",
"- Optimizely: https://docs.mparticle.com/integrations/optimizely/\n",
"- Amplitude: https://docs.mparticle.com/integrations/amplitude/\n",
"- Webhooks: https://docs.mparticle.com/integrations/webhook/\n",
"\n",
"## Sample End-to-End integration with AWS Retail Demo Store - mParticle and Braze\n",
"\n",
"Please see a gif showcasing how mParticle can streamline Events captured from the AWS Retail Demo Store and trigger certain push notification events to a customer base on certain interactions captured by mParticle from the website.\n",
"\n",
"
\n",
"\n",
"## Extra: Extend the mParticle Profile to other Systems using the mParticle Profile API\n",
"\n",
"Please contact mParticle if you want to test this feature out as this wont be automatically be available in your free trial platform.\n",
"\n",
"The Profile API - https://docs.mparticle.com/developers/profile-api can be used to query identities, user attributes, audience memberships, and other data available on an mParticle User Profile, anywhere you can make an HTTP request. Profile API can be used to drive one-to-one personalized experiences for your users across any channel:\n",
"\n",
" Deliver customized product or content recommendations\n",
" Identify churn-risk customers in an automated voice support flow and launch a win-back campaign.\n",
" Deliver personalized offers in brick and mortar stores by integrating your point-of-sale systems.\n",
" \n",
" Here is an example of the returned profile over a known customer by mParticle\n",
" \n",
" ```json\n",
" {\n",
" \"postData\": {\n",
" \"mpid\": -1082302702687864000,\n",
" \"created_timestamp_ms\": 1629201161323,\n",
" \"last_stored_timestamp_ms\": 1629693472280,\n",
" \"is_opted_out\": false,\n",
" \"limit_ad_tracking\": null,\n",
" \"device_identities\": [],\n",
" \"user_identities\": [\n",
" {\n",
" \"type\": \"customer_id\",\n",
" \"encoding\": \"none\",\n",
" \"value\": \"user1113\"\n",
" },\n",
" {\n",
" \"type\": \"email\",\n",
" \"encoding\": \"none\",\n",
" \"value\": \"elaine.murray@example.com\"\n",
" }\n",
" ],\n",
" \"user_attributes\": {\n",
" \"$FirstName\": \"Elaine\",\n",
" \"$LastName\": \"Murray\",\n",
" \"$Gender\": \"F\",\n",
" \"$Age\": \"26\",\n",
" \"amazonPersonalizeId\": \"1113\",\n",
" \"persona\": \"tools_housewares_apparel\",\n",
" \"$City\": \"Jeffreyfurt\",\n",
" \"$Country\": \"US\",\n",
" \"$Zip\": \"98540\",\n",
" \"$State\": \"WA\",\n",
" \"signUpDate\": \"2021-08-23T04:16:26.991Z\",\n",
" \"lastSignInDate\": \"2021-08-23T04:16:26.991Z\",\n",
" \"product_recs\": [\n",
" \"f0054758-eaca-47f8-adf4-12b78603fbc6\",\n",
" \"09920b2e-4e07-41f7-aca6-47744777a2a7\",\n",
" \"59b0aeff-c1cc-4d7c-b928-dec5457942e0\",\n",
" \"473d7251-7eaf-4b7a-9f87-ff6f7897d565\",\n",
" \"9943c887-d454-420d-a39b-b4a81e2980b7\"\n",
" ],\n",
" \"product_recs_name\": [\n",
" \"Burn! Lipstick\",\n",
" \"Trendy Razor\",\n",
" \"Cotton Swabs\",\n",
" \"Gloss Bomb Universal Lip Luminizer\",\n",
" \"Sienna Handbag\"\n",
" ],\n",
" \"ltv\": \"31.99\",\n",
" \"ca_last_products_purchased\": [\n",
" \"Gloss Bomb Universal Lip Luminizer\",\n",
" \"Outstanding Socks\"\n",
" ]\n",
" },\n",
" \"audience_memberships\": [\n",
" {\n",
" \"audience_id\": 33025,\n",
" \"audience_name\": \"non_engaged_podcast_users\",\n",
" \"expiration_timestamp_ms\": null\n",
" }\n",
"{\n",
" \"audience_id\": 33945,\n",
" \"audience_name\": \"low_ltv_customers\",\n",
" \"expiration_timestamp_ms\": null\n",
" }\n",
" ]\n",
" }\n",
"}\n",
" ```\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"interpreter": {
"hash": "0dcd9f5e34f8df8f8894486951f66d4acf74e4779e08f447b14b2a31d4107ec6"
},
"kernelspec": {
"display_name": "conda_python3",
"language": "python",
"name": "conda_python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.13"
}
},
"nbformat": 4,
"nbformat_minor": 2
}