Sunday, March 25, 2018

HTML5 Video Tracking using Launch by Adobe

Tracking interactive media such as video is often a mandatory requirement for clients as they want to gauge the effectiveness of media on their website or app to influence ad revenue or sales. Companies like Youtube, Hulu, ABC or Comcast put a lot of emphasis on tracking video metrics. More the video views, more their ad revenue so it's usually one of the first platforms they want to measure.

Tracking video players typically requires developers to embed code into the video player and fire off tracking beacons triggered from an analytics platform's plug-in. Plug-ins such as Milestone (legacy) and platforms such as Heartbeat (latest) for Adobe Analytics allow clients to track video on their website. Every video implementation I've been involved with (including HTML5), requires both the developer and the technical consultant to implement custom JavaScript logic within the video player and Tag Manager respectively.


Recently, I was involved in helping a client migrate from their legacy (H) code's Milestone tracking code hosted via on-page Analytics code onto the latest analytics (AppMeasurment) library in the Launch by Adobe tag management platform. Sounds simple right? Nope, as their video player (HTML5) had a ton of JavaScript code embedded within the video player and in the analytics configuration file. After looking into our internal documentation, it was apparent that there was no easy migration path as their Milestone library was implemented along with the legacy analytics H code and isn't compatible with the newest AppMeasurment library. The other thing that was challenging is that Milestone video tracking method is no longer supported by Adobe.


This prompted me to host a HTML5 video player with NO video related JavaScipt code, I repeat NO embedded JavaScript code on my own sandbox environment and implement a basic instance of the Launch Tag management solution with AppMeasurement. After validating the approach, I asked the client to implement the same methodology on their own website and it met their requirement.


Please note that to capture video name, I updated the video ID in HTML to capture a user friendly video name that is the only piece of video related 'code' I added on the page. The other thing to keep in mind is that my approach leverages link tracking events to track video events. Below are the steps I took to track metrics such as video start, video 25%, 50%, 75%, 100% complete and dimensions such as friendly video name and others.


Inject Launch by Adobe async JS library: Adobe recommends injecting the async Launch library in the head of the page as it's faster and non-blocking.




Implement AppMeasurement code in Launch: Implement the latest AppMeasurement code in Launch which is what I did for my client. Here's a general screenshot of the extension.



Track Video Name in Launch: We create a data element to capture the video name using the video ID HTML tag where we embed a friendly name. There are other approaches to grab this from the page by writing custom code but I did this to make the migration process seamless for my client. Below is a screenshot of what the video ID looks in the HTML.



Next, we create a simple data element in Launch where our data element captures a "DOM Attribute" called "video" as shown below that is tied directly to our HTML.



Create a Rule to track Video Start: Once we've setup the data element to capture the video name, we now need to setup individual rules in Launch to capture video events. The first video event we want to create is the video start event where we trigger the video event when 1% of the video has been viewed. This made sense to my client as he agreed that unless a user has viewed 1% of the video, it's not really a 'true' video start. So in the scenario, we'd choose the "Data Element Type" as "Media Time Played" triggered when 1% of the video has played. I've added a caveat at the end of the article to explain why we didn't use the "Media Play" event type.



Next, we scroll down to the "Actions' section to set our analytics variables and send a beacon for the video start event as shown below. Please note that we need to do this for each rule we'll create for tracking video events.



The next two steps show what we need to populate in the "Adobe Analytics - Set Variables" and "Adobe Analytics - Send Beacon" actions. Please note that we've defined unique analytics events for each milestone event and an eVar to capture the video name.





Create Rules to track Video Milestones 25%, 50%, 75% Events: We now setup milestone events to track 25%, 50% and 75% complete video events which is a very common tracking requirement for videos. The screenshots below show how we set it up for 25% video complete event but the same steps need to be followed for 50% and 75% complete events where the 25% trigger needs to be replaced with 50% and 75% accordingly.







Create a Rule to capture Video Complete: The last step is to capture the video complete event that can be captured by choosing the "Media Ended" event type in the rule as shown below.




Validate the Video Events: We now test our setup by loading the video in a browser and filtering for "/b/ss" which is a filter we apply to test the Adobe Analytics image request. In the following screenshots, I've included analytics image request for video start, 25% complete and video complete events.







The very last step of the process is for us to validate the data in the Adobe Analytics UI. The following screenshot shows how the report will look like with all video events successfully setup.


Finally, I want to add a few caveats about my post as video tracking is generally very involved:
  • HTML5 is typically the easiest video player to implement analytics tracking on but other players like Brigtcove, YouTube or JW Player may not work with this approach as they are not directly part of the HTML like HTML5 is and typically require additional JavaScript code embedded in the player and page. For other players, it is recommended to use the Heartbeat or traditional video tracking methods.
  • My method fires the video start event when 1% of the video is completed so if a video is 10 minutes long, it may take 6 seconds to fire the start event. "Video Start" event type in Launch on the other hand, triggers a beacon every time a video is played which causes duplication of the start event. 
  • There are many other attributes that are associated with video that are not tracked here. Some of them are Content type, Player name, Show/Episode name/Season (TV shows) or Ad related attributes tied to a campaign.
I hope you like this post but I'd like to know if you have alternative ways by which you track video players. As always, comments and feedback is welcome.

Sunday, March 11, 2018

Upload Offline Customer Data into Adobe Audience Manager (Part 2)


This post is a continuation to Part 1 of the series where I’m covering how to upload offline customer data to AAM. This post goes even deeper into the weeds and covers how we can add, modify and remove (we cannot really delete data from the backend but can exclude users) customer data from AAM. There are different ways to configure the batch upload file for AAM, but this post only shows how to leverage key-value pairs to bring in data. The official Adobe documentation goes into some more detail on those other methods.

Let’s first take a look at a few steps we need to take as a prerequisite before uploading batch files:
  1. File Extensions: There are two types of file extensions that are supported in the file name. The first one is “.sync” that is used to add records to Audience Manager and the other one is “.overwrite” that is used to overwrite or modify records. These two were covered in a lot of detail in the previous section.
  2. File Name: The file name starts with 'ftp_dpm' (fixed) followed by a random number typically less than 10 digits along with the file extension. So, an example file name can be: ftp_dpm_Data-Source-ID_201831012.sync|.overwrite where the data source ID is the same as '#1' in the screenshot below, number used is in the “Year/Month/Date” format (can be anything) and .sync or .overwrite are the file extensions.
  3. File Size: Each file should ideally not exceed more than 5GB and can be zipped using .gz so if you need to upload greater than 5GB then you can upload multiple files. The nomenclature of these files will be named like ftp_dpm_Data-Source-ID_123456789.sync.1.gz or ftp_dpm_Data-Source-ID_123456789.sync.2.gz.
  4. Attribute Limit: According to Adobe’s documentation referred earlier, there is a limit of 200 lines Adobe can process for each user ID sent in the inbound data file.
  5. Column Structure of the File: As covered in the previous section, the user ID is in the first column. The second column (separated by a tab) contains all key value pairs separated by a comma. Some points to consider:
    • It’s easy to mix up the “ double quote with the " quotes being used in the second column. The double quote that will work is the " quote so it’s better to use a separate text editor to configure the file as excel might switch up the quotes being used.
    • Numeric data can be sent as a string in the file but in the AAM UI, they will be evaluated as numbers so logical operators such as "<" OR ">" can be used while creating traits.
    • Make sure that the tab between column one and column two is actually a tab and not a space as that will break the file format.
  6. Data Source Setup: As discussed in the previous post, one of the first things we need to capture to initiate a batch upload process is to capture the authenticated user ID on the website. The data source ID (#1) is hard coded into the batch file name which covered in the third step. We tie this ID to Audience Manager via an integration code (#2 below) by initiating an ID sync. The user ID needs to be mapped to a data source by tying the user ID to the Customer ID inbound field (#3). Also, enable the option to sample errors so that you can pinpoint the exact cause in case of a failure. 
Source: Audience Manager UI

We're now going to cover how to add, modify and remove records from Audience Manager while leveraging key-value pairs:
  • Add New Records to Audience Manager (".sync" format): This is the most common type of upload where we simply add new user IDs along to the first column and user attributes to the second column as shown below. The file format used here is “.sync”.
  • Modify Already Uploaded Records (".overwrite" format): In this type of upload using the “.overwrite” format, we add all existing attributes of the user along with the modified records. In the example below, we’ve uploaded all existing records and only modified the ‘age’ and ‘purchases_last_month’ fields. If we don’t add certain attributes added previously, those attributes will not be part of user qualification moving forward.
  • Add New Attributes to Existing Records: If you want to add a new attribute to an existing record (user ID), there are two ways to do this:
    • (".overwrite" format): In this format, we include all existing records for a user along with the new attribute (company_size) as shown below:
    • (".sync" format): In this format, we include just the new attributes (company_size) we need to add  for a user as shown below:
  • Add Multiple Values for the same Dimension (".sync" format): We simply add the dimension that we wish to add data for multiple times in the same row as shown below:

  • Remove Attributes from Existing Records (".overwrite" format): If you want to remove a certain attribute from exiting records, upload an ".overwrite" file with just the attributes you wish to keep and exclude the one you wish to remove. In the example below, we've removed the 'company_size' attribute that we added earlier. Also, note that we included the updated 'age' and 'purchases_last_month' fields:

  • Delete Records from Audience Manager: There is no way to really "delete" a record from Audience Manager. The recommended approach is to include an attribute/flag (E.g. existing_customer=N) in the batch file and add it as a condition in AAM. Users with this flag can be part of an exclusion list that can be uploaded to a DSP so that they're not targeted moving forward.
The research went into these two posts took months but I'm hopeful that this post will act as a guide on how upload customer data into Audience Manager. I'll appreciate your feedback and comments.

Saturday, February 10, 2018

Upload Offline Customer Data into Adobe Audience Manager (Part 1)

Almost all customers I’ve worked with have a CRM (Customer Relationship Management) system where they store information about their current and prospective customers. A very common requirement for customers to make their CRM system actionable is to connect their offline CRM data with online data. 

Previously, I wrote about marketing use cases that are met using a Data Management Platform. In this article, I'm going to go a little deeper into Adobe Audience Manager (AAM) and cover how to import customer data from their backend system into the DMP. In the first of this two-part series, I'll go through the various steps needed to perform a successful CRM data upload and the second post will go into the granular details of how CRM attributes in these files are created, modified and deleted.

There are a lot of use cases (E.g. uploading Point of sale, customer lifetime value, last purchase date etc.) that can be accomplished using CRM data so it becomes necessary to understand WHY we’re even bringing this data into AAM. To get started, the first and foremost thing that we need to be aware of before setting up a CRM upload is that no PII (personally identifiable information) should be passed over to AAM. PII is data that can be tied directly to the user such as SSN email address, name, date of birth etc. and it’s imperative that no such data is brought in that can expose personal information about customers. 

We will now cover the various steps that are part of the offline file upload process. These may look like a lot of steps to just upload a flat file, but I believe it's important to follow these steps to make the most from this effort.

1.   Discuss Business Objectives: Before undertaking a CRM upload, it’s necessary to ask what business objectives are we trying to achieve. In my experience, I’ve seen clients request everything they can but I believe the right approach is to start simple to achieve small wins and then focus on additional components. Once clients have a few CRM segments they’ve acted on, they can start bringing in more data.

2.     Create and configure the file: The upload file format accepted by AAM is pretty simple as it only contains two columns. The first column is the hashed/anonymized user ID and the second column is a key value pair combination of CRM attributes separated by a comma (example below). In the second part, I’ll cover all aspects of how these files are created and modified.



3.     Create On boarded traits in AAM: Once we know the structure of the file, the next step is to create on boarded traits in Audience Manager. Traits are built off a combination of key value pairs and are the most granular data point in AAM. An example of a trait is shown below that is built off a condition where the gender is female. The trait logic can be expanded to include other conditions such as age, state etc. depending on what we’re looking to capture. It’s important to note that traits need to be created before we upload the offline file.

Source: Audience Manager Trait UI

4.   Perform an ID Sync: This is a critical piece of the CRM file upload process where we sync the CRM user ID with the Audience Manager cookie typically upon authentication or when a user opens an email. The CRM ID acts as the primary key that is the common link between the backend and the Web or App.
If we upload the CRM file without this sync, AAM will not be able to tie the backend system with its cookie thereby not populating anything in the UI. Aside from this, the other important point to keep in mind is that the user ID or email address captured upon authentication needs to be anonymized/hashed before it’s sent to AAM so that it cannot be traced back to the user. I will write more about the general ID sync process in a future post.

5.     Upload the file: Once the ID sync is setup, we now need to send the finalized CRM file to Audience Manager. AAM accepts offline files in either the S3 bucket or in a SFTP location. The most common approach is to upload a daily CRM file with new customer data every day via an automated file drop process. S3 is Adobe’s preferred data storage platform due to its scalability, security and speed just to name a few advantages. Some other advantages of S3 are documented here.

6.     Monitor the Onboarding Status report in AAM: The Onboarding Status report in AAM provides a complete summary of records/rows that were either successful or unsuccessful during the upload process. Adobe picks and processes these files twice a day and expects the file contents and name in a certain format. The file contents and name need to match the expected format exactly as AAM requires otherwise it'll error out which is the most common reason for errors. Below is an example of a successfully uploaded file from this report as shown here.


                                                                                     Source: Audience Manager Onboarding Status report

7.     Tweak if necessary: It's not uncommon to see issues early on with the file format to get it right so it'll makes sense to set aside some time and be prepared to make changes. Once the changes and tweaks to the file is made, we can upload it again to the drop folder.

8.     Check On-Boarded traits for data: Once the file has been successfully uploaded and processed which typically takes between 24-48 hours, we need to monitor if data has started flowing into the various on boarded traits that we created (Step 3). If the trait specific metrics have data, we're good to proceed to the next step.

9.     Create Segments: Once these CRM data based traits have started populating with data, we need to filter the uploaded data tied to the business objectives that were defined upfront. This is done by building segments in AAM based off CRM data or other data sources. An example might be creating a segment comprising of users who haven't bought for the last six months (CRM) to provide them with a 15% off coupon when they visit the website (online).

10.  Activate: The final step of the process is to start sharing these segments with personalization and advertising platforms to deliver customized messages to our customers. A common example is to send these segments from the DMP to a personalization platform such as Adobe Target to deliver contextual and personalized content to customer. 

Now that we’ve covered all the steps required in this process, it's on us to determine if we can start working on these but it all has to start with documenting our business objectives. Once we've successfully setup the upload process covered in more detail here, we need to build/learn from where we started to deliver a better experience to customers and monetize from our upfront effort. Do you use your CRM data to deliver tailored messages to customers coming to your site or App?