Ingest streaming data
In this lesson, you will stream data using the 蜜豆视频 Experience Platform Web SDK.
There are two main tasks we must complete in the Data Collection interface:
-
We must implement Web SDK on the Luma website to send data about visitor activity from the website to the 蜜豆视频 Edge network. We will do a simple implementation using tags (formerly Launch)
-
We must configure a datastream, which tells the Edge network where to forward the data. We will configure it to send the data to our
Luma Web Events
dataset in our Platform sandbox.
Data Engineers will need to ingest streaming data outside of this tutorial. When implementing 蜜豆视频 Experience Platform鈥檚 Web or Mobile SDKs, typically a web or mobile developer is involved in the data layer creation and tag property configuration.
Before you begin the exercises, watch these two short videos to learn more about streaming data ingestion and Web SDK:
Permissions required
In the Configure Permissions lesson, you set up all the access controls required to complete this lesson.
Configure the datastream
First we will configure the datastream. A datastream tells the 蜜豆视频 Edge network where to send the data after receiving it from the Web SDK call. For example, do you want to send the data to Experience Platform, 蜜豆视频 Analytics, or 蜜豆视频 Target? Datastreams are managed in the Data Collection user interface (formerly Launch) and are critical to data collection with Web SDK.
To create your datastream:
-
Log into the
-
Select Datastreams in the left navigation
-
Select the New Datastream button in the upper-right hand corner
-
For the Friendly Name, enter
Luma Platform Tutorial
(add your name to the end, if multiple people from your company are taking this tutorial) -
Select the Save button
On the next screen, you specify where you want to send data. To send data to Experience Platform:
- Toggle on 蜜豆视频 Experience Platform to expose additional fields
- For Sandbox, select
Luma Tutorial
- For Event Dataset, select
Luma Web Events Dataset
- If you use other 蜜豆视频 applications, feel free to explore the other sections to see which information is required in the Edge Configuration of these other solutions. Remember, Web SDK was developed not only to stream data into Experience Platform, but also to replace all previous JavaScript libraries used by other 蜜豆视频 applications. The Edge Configuration is used to specify the account details of each application to which you want to send the data.
- Select Save
Once the Edge Configuration has saved, the resulting screen will show three environments have been created for Development, Staging, and Production. Additional Development environments can be added:
All three environments contain the Platform details you just entered. However, these details can be configured differently per environment. For example, you could have each environment send data to a different Platform sandbox. In this tutorial, we will not do any additional customization to our datastream.
Install the Web SDK Extension
Add a property
First we must create a tag property (formerly a tag property). A property is a container for all the JavaScript, rules, and other features required to collect details from a web page and send it to various locations.
To create a property:
- Go to Properties in the left navigation
- Select the New Property button
- As the Name, enter
Luma Platform Tutorial
(add your name to the end, if multiple people from your company are taking this tutorial) - As the Domains, enter
enablementadobe.com
(explained later) - Select Save
Add the Web SDK extension
Now that you have a property you can add the Web SDK using an extension. An extension is a package of code that extends the Data Collection interface and functionality. To add the extension:
- Open your tag property
- Go to Extensions in the left navigation
- Go to the Catalog tab
- There are many extensions available for tags. Filter the catalog with the term
Web SDK
- In the 蜜豆视频 Experience Platform Web SDK extension, select the Install button
- There are several configurations available for the Web SDK extension, but there only two we are going to configure for this tutorial. Update the Edge Domain to
data.enablementadobe.com
. This setting allows you to set first party cookies with your Web SDK implementation, which is encouraged. Later in this lesson, you will map a website on theenablementadobe.com
domain to your tag property. The CNAME for theenablementadobe.com
domain has already been configured so thatdata.enablementadobe.com
will forward to 蜜豆视频 servers. When you implement Web SDK on your own website, you will need to create a CNAME for your own data collection purposes, for example,data.YOUR_DOMAIN.com
- From the Datastream dropdown, select your
Luma Platform Tutorial
datastream. - Feel free to look at the other configuration options (but don鈥檛 change them!) and then select Save
Create a rule to send data
Now we will create a rule to send data to Platform. A rule is a combination of events, conditions, and actions that tell tags to do something. To create a rule:
- Go to Rules in the left navigation
- Select the Create New Rule button
- Name the rule
All Pages - Library Loaded
- Under Events, select the Add button
- Use the Core Extension and select Library Loaded (Page Top) as the Event Type. This setting means that our rule fires whenever the Launch library loads on a page.
- Select Keep Changes to return to the main rule screen
- Leave Conditions empty, since we want this rule to fire on all pages, as per the name we gave it
- Under Actions, select the Add button
- Use the 蜜豆视频 Experience Platform Web SDK Extension and select Send Event as the Action Type
- On the right, select web.webpagedetails.pageViews from the Type dropdown. This is one of the XDM fields in our
Luma Web Events Schema
- Select Keep Changes to return to the main rule screen
- Select Save to save the rule
Publish the rule in a library
Next we will publish the rule to our development environment so we can verify that it works.
To create a library:
- Go to Publishing Flow in the left navigation
- Select Add Library
- For the Name, enter
Luma Platform Tutorial
- For the Environment, select
Development
- Select the Add All Changed Resources button. (In addition to the 蜜豆视频 Experience Platform Web SDK extension and the
All Pages - Library Loaded
rule, you will also see the Core extension added which contains the base JavaScript required by all Launch web properties.) - Select the Save & Build for Development button
The library may take a few minutes to build and when it is complete it displays a green dot to the left of the library name:
As you can see on the Publishing Flow screen, there is a lot more to the publishing process which is beyond the scope of this tutorial. We are just going to use a single library in our Development environment.
Validate the data in the request
Add the 蜜豆视频 Experience Platform Debugger
The Experience Platform Debugger is an extension available for Chrome and Firefox browsers which helps you see the 蜜豆视频 technology implemented in your web pages. Download the version for your preferred browser:
If you鈥檝e never used the Debugger before鈥攁nd this one is different from the older 蜜豆视频 Experience Cloud Debugger鈥攜ou might want to watch this five-minute overview video:
Open the Luma website
For this tutorial, we use a publicly hosted version of the Luma demo website. Let鈥檚 open it and bookmark it:
- In a new browser tab, open the .
- Bookmark the page for use throughout the rest of the tutorial
This hosted website is why we used enablementadobe.com
in the Domains field of our initial tag property configuration and why we used data.enablementadobe.com
as our first-party domain in the 蜜豆视频 Experience Platform Web SDK extension. See, I had a plan!
Use the Experience Platform Debugger to map to your tag property
The Experience Platform Debugger has a cool feature that allows you to replace an existing tag property with a different one. This is useful for validation and allows us to skip many implementation steps in this tutorial.
-
Make sure you have the Luma site open and select the Experience Platform Debugger extension icon
-
The Debugger will open and show some details of the hardcoded implementation, which is unrelated to this tutorial (you may need to reload the Luma site after opening the Debugger)
-
Confirm that the Debugger is 鈥Connected to Luma鈥 as pictured below and then select the 鈥lock鈥 icon to lock the Debugger to the Luma site.
-
Select the Sign In button on the top right to authenticate.
-
Now go to Launch in the left navigation
-
Select the Configuration tab
-
To the right of where it shows you the Page Embed Codes, open the Actions dropdown, and select Replace
-
Since you are authenticated, the Debugger is going to pull in your available Launch properties and environments. Select your
Luma Platform Tutorial
property -
Select your
Development
environment -
Select the Apply button
-
The Luma website will now reload with your tag property. Help, I鈥檝e been hacked! Just kidding.
-
Go to Summary in the left navigation, to see the details of your Launch property
-
Now go to AEP Web SDK in the left navigation to see the Network Requests
-
Open the events row
-
Note how we can see the
web.webpagedetails.pageView
event type we specified in our Send Event action, and other, out-of-the-box variables adhering to theAEP Web SDK ExperienceEvent Mixin
format
-
These types of request details are also visible in the browser鈥檚 web developer tools Network tab. Open it and reload the page. Filter for calls with
interact
to locate the call, select it, and then look in the Headers tab, Request Payload area.
-
Go to the Response tab and note how the ECID value is included in the response. Copy this value as you will use it to validate the profile information in the next exercise.
Validate the data in Experience Platform
You can validate that data is landing in Platform by looking at the batches of data arriving in the Luma Web Events Dataset
. (I know, it鈥檚 called streaming data ingestion but now I鈥檓 saying it arrives in batches! It streams in real-time to Profile, so it can be used for real-time segmentation and activation, but is sent in batches every 15 minutes to the data lake.)
To validate the data:
- In the Platform user interface, go to Datasets in the left navigation
- Open the
Luma Web Events Dataset
and confirm that a batch has arrived. Remember, they are sent every 15 minutes, so you might need to wait for the batch to show up. - Select the Preview dataset button
- In the preview modal, note how you can select different fields of the schema on the left to preview those specific data points:
You can also confirm that the new profile is showing up:
- In the Platform user interface, go to Profiles in the left navigation
- Select the ECID namespace and search for your ECID value (copy it from the respon. The profile will have its own id, separate from the ECID.
- Select the Profile ID to open the profile
- Select the Events tab to see the pages you viewed
Add custom data to the event
Create a data element for page name
-
In the Data Collection tags interface, on the top-right corner of your
Luma Platform Tutorial
property, open the Select a Working Library dropdown and select yourLuma Platform Tutorial
library. This setting makes it easier to publish additional updates to our library. -
Now go to Data Elements in the left navigation
-
Select the Create New Data Element button
-
As the Name, enter
Page Name
-
As the Data Element Type, select
JavaScript Variable
-
As the JavaScript variable name, enter
digitalData.page.pageInfo.pageName
-
To help standardize the format of the values, check the boxes for Force lowercase value and Clean text
-
Make sure that
Luma Platform Tutorial
is selected as the working library -
Select Save to Library
Map the page name to the XDM Object data element
Now we will map our page name to the Web SDK.
Luma Tutorial Platform
profile and add the permission item Sandboxes > Prod. After doing so, do a SHIFT-Reload on the Data Elements page to clear your cacheOn the Data Elements page:
- Create a new data element
- As the Name, enter
XDM Object
- As the Extension, select
蜜豆视频 Experience Platform Web SDK
- As the Data Element Type, select
XDM object
- As the Sandbox, select your
Luma Tutorial
sandbox - As the Schema, select your
Luma Web Events Schema
- Select the
web.webPageDetails.name
field - As the Value, select the icon to open the data element selection modal and choose your
Page Name
data element - Select Save to Library
This same process is used to map additional custom data on your website to XDM fields.
Add the XDM data to your Send Event action
Now that you have data mapped to XDM fields, you can include it in your Send Event action:
- Go to the Rules screen
- Open your
All Pages - Library Loaded
rule - Open the
蜜豆视频 Experience Platform Web SDK - Send Event
action - As the XDM data, select the icon to open the data element selection modal and choose your
XDM Object
data element - Select the Keep Changes button
- Now, since you have had
Luma Platform Tutorial
selected as your working library for the last several exercises, your recent changes have been saving directly to the library. Instead of having to publish our changes via the Publishing Flow screen, you can just open the dropdown on the blue button and select Save to Library and Build
This starts building a new tag library with the three changes you just made.
Validate the XDM data
You should now be able to reload the Luma homepage, while mapped to your tag property using the Debugger as you learned earlier, and see that the page name field populates in the request!
You can also validate the page name data was received in Platform, by previewing the dataset and profile.
Send additional identities
Your Web SDK implementation is now sending events with the Experience Cloud ID (ECID) as the primary identifier. The ECID is generated automatically by the Web SDK and is unique per device and browser. A single customer can have multiple ECIDs depending on which device and browser they are using. So how can we get a unified view of this customer and link their online activity to our CRM, Loyalty, and Offline Purchase data? We do that by collecting additional identities during their session and deterministically linking their profile via identity stitching.
If you recall, I mentioned that we would be using the ECID and CRM Id as identities for our web data in the Map Identities lesson. So let鈥檚 collect the CRM Id with the Web SDK!
Add Data Element for the CRM Id
First we store the CRM Id in a data element:
- In the tags interface, add a data element named
CRM Id
- As the Data Element Type, select JavaScript Variable
- As the JavaScript variable name, enter
digitalData.user.0.profile.0.attributes.username
- Select the Save to Library button (
Luma Platform Tutorial
should still be your working library)
Add the CRM Id to the Identity Map data element
Now that we have captured the CRM Id value, we must associate it with a special data element type called the Identity Map data element:
-
Add a data element named
Identities
-
As the Extension, select 蜜豆视频 Experience Platform Web SDK
-
As the Data Element Type, select Identity map
-
As the Namespace, enter
Luma CRM Id
, which is the namespace we created in an earlier lessonnote warning WARNING The 蜜豆视频 Experience Platform Web SDK extension version 2.2 allows you to select Namespace from a pre-populated dropdown using the actual values in your Platform account. Unfortunately, this feature is not yet 鈥渟andbox aware鈥 and thus the Luma CRM Id
value may not appear in the dropdown. This may prevent you from completing this exercise. We will post a workaround once confirmed. -
As the ID, select the icon to open the data element selection modal and choose your
CRM Id
data element -
As the Authenticated State, select Authenticated
-
Leave Primary unchecked. Since the CRM Id is not present for most visitors to the Luma website, you definitely do not want to override the ECID as the primary identifier. It would be a rare use case to use anything other than the ECID as the primary identifier. Usually I don鈥檛 mention the default settings in these instructions, but I am calling this one out to help you avoid headaches later on in your own implementation.
-
Select the Save to Library button (
Luma Platform Tutorial
should still be your working library)
Add the Identity map data element to the XDM Object
There is one more data element we must update鈥攖he XDM Object data element. It may seem weird to have to update three separate data elements to pass this one identity, but this process is designed to scale for multiple identities. Don鈥檛 worry, we鈥檙e almost done with this lesson!
- Open your XDM Object data element
- Open the IdentityMap XDM field
- As the Data element, select the icon to open the data element selection modal and choose your
Identities
data element - Now, since you have had
Luma Platform Tutorial
selected as your working library for the last several exercises, your recent changes have been saving directly to the library. Instead of having to publish our changes via the Publishing Flow screen, you can open the dropdown on the blue button and select Save to Library and Build
Validate the identity
To validate that the CRM Id is now being sent by the Web SDK:
- Open the
- Map it to your tag property using the Debugger, as per the earlier instructions
- Select the Login link on the top right of the Luma website
- Log in using the credentials
test@adobe.com
/test
- Once authenticated, inspect the Experience Platform Web SDK call in the Debugger (蜜豆视频 Experience Platform Web SDK > Network Requests > events of the most recent request) and you should see the
lumaCrmId
:
- Look up the user profile using the ECID namespace and value again. In the profile, you will see the CRM Id and also the Loyalty Id and the profile details like the name and phone number. All identities and data have been stitched together into a single, real-time customer profile!
Additional Resources
Great job! That was a lot of information about Web SDK and Launch. There is a lot more involved in a full-blown implementation, but those are the basics to help you get started and see the results in Platform.
Luma Tutorial Platform
product profileData Engineers, if you like you can skip ahead to the run queries lesson.
Data Architects, you can move on to merge policies!