Showing posts with label mobile. Show all posts
Showing posts with label mobile. Show all posts

Sunday, July 28, 2019

Miscellaneous Facts About Adobe Analytics

At the start of this year, I wrote an article about Audience Manager on which I'm going to structure this article. The only difference is that this article will cover some random facts about Adobe Analytics which are not commonly known or are rarely discussed. One of my co-workers Adam Waddington has also shared his experience on an issue he faced with a client which is covered in the first bullet point followed up by some other facts which I've shared.

1. Segments Are Tied To SAINT Classified Dimensions


This is based on a recent issue which Adam faced while deleting a classified column as part of a new SAINT upload where segments mapped to one of the deleted columns stopped working. Below is a verbatim writeup of what Adam sent me and I hope you will find what he shared useful. Thanks Adam!



Segments built using classified variables follow a unique reference method that is highly sensitive to changes in SAINT tables and order. Unlike eVars, props, and standard OOTB dimensions, classified variables are referenced by segments using a back-end numeric ID (aka ‘Div’) prior to use in reporting. These Div#’s are set at the time AA Classifications are added, incremented by 1 from top-to-bottom.


AA Classification Order
Backend Numeric ID
Segment Reference
Classification 1
Div1
Div1
Classification 2
Div2
Div2
Classification 3
Div3
Div3

Similarly, the segment reference Div is set at the time each segment is created and - depending on the type of change being made to Classifications in AA - there can be several (potentially severe) business and reporting impacts: 
  • DELETING a classification in AA removes that variable and its associated Div data from the backend. Any segment which leveraged the classified variable linked to that Div will then become ‘Undefined’ and segments will not function as intended.
  • EDITING or renaming a classification in AA has no effect on the Div itself. However, any segment which uses that modified classification will now show the updated name provided.
  • ADDING a classification will always default to incrementing by +1 on the highest Div# in the system, even if a lower Div# was deleted. For example, deleting Classification 2 from the above table and subsequently adding a new Classification will create Div4; Div2 (Classification 2) will still not exist. In order to add Div2 (in this example), the user must delete all Classifications below 1, add Classification 2 again, and re-upload the desired SAINT tables.

2.  s.transactionID Can Be Used To Reconcile Missing Orders

Late last year I wrote an article about data variance between Web Analytics tools and mentioned that there is a way to reconcile missing eCommerce orders on the purchase page with the help of Adobe engineering.  This can be accomplished by passing s.transactionID on a page prior to a confirmation page and data can be reconciled by engineering. The trick is to pass the s.transactionID right before the purchase page on the page (client side) as well as in the backend (server side). 


This is not straightforward as it will require additional support from your developers but our engineering team can take the two transactionIDs, reconcile them in the backend then backfill any missing orders. Please note that there will be an additional cost to work with engineering as well so ONLY do this if it's absolutely necessary.

3. Sending Historical Data To Adobe Analytics Is Possible BUT..


This is accomplished by passing over historical attributes (eVars, props, events etc.) along with the timestamp variable (s.timestamp) but the main issue is out of order nature of events being sent in as it can affect the sequence of events and attribution of eVars. The only use case I've seen for this is backfilling historical or missing data and should ONLY be done when you have no other option. I've included a sample below using a GET request via the Data Insertion API method. 


Notice that the timestamp is for a previous time frame. I'd also suggest changing the timestamp setting in your report suite to optional for best results especially if you're using a global setup capturing both mobile app and desktop data.

http://(tracking server)/b/ss/(rsid)/0?AQB=1&pccr=true&g=none&ts=1559335477&products=;testvarn;1;5.95&events=event1&pageName=testPN&mid=5670954657508492467610283427418697012&AQE=1


4. Possible To Send Negative Revenue In The Products String

One other rare scenario is where your client side code accidentally captures a really large order value which messes up your overall Revenue metric. This happened recently for a client where they accidentally sent over a Million dollars for a single SKU. There is a way to fix that by sending an equivalent negative revenue amount for the same SKU for which you accidentally sent the wrong amount. I've demonstrated it using a small amount of $400 but the concept is the same.



The first screenshot shows that we "accidentally" sent a revenue of $400.

This shows what the products string will look like when we send negative revenue amount. Note that we sent a different purchase ID as the same purchase ID cannot be used to send a different order as duplicate order IDs are ignored by Adobe.

Finally, we can see that the overall revenue for SKU123ABC is now $0 as we sent a negative revenue amount. The other thing to consider is that you'll have an additional Orders event captured as we used a new purchase ID but in the larger scheme of things, you can live with that and ignore it via segmentation.

5. tntA Variable Can Be Sent To Tie Analytics With Target (A4T)

This is from a recent test I did with a client while testing A4T where Analytics is deployed server side but Target is deployed client side. The data is sent to Adobe Analytics via Data Insertion API and the challenge was that there was no concept of a Supplemental Data ID matching Analytics and Target which is used to tie Analytics with Target client side. 

In this case, the fix is to send the tntA variable (captures A/B test variant information) which can be passed as a query string parameter both on page view and click events. This ensures that client side Target matches up with Adobe Analytics deployed server side and populates the A4T reports. Below is a sample (event) snippet you can send to test this which will populate the Analytics for Target reports in Adobe Analytics. Note that we've added pe=tnt to denote that it's a click event other for page views, you'll simple pass the tnta param without pe=.

http://(tracking server)/b/ss/(rsid)/0?ts=1559335477&products=;testpev;1;5.95&events=event1&pageName=testpev&mid=5670954657508492467610283427418697012&pe=tnt&tnta=291105:0:0|1

6. Submit Expected Traffic Spikes Well In Advance

A lot of businesses have expected traffic spikes each year during seasonal events such as Thanksgiving and it's quite common for them to schedule traffic spikes for their Adobe Analytics report suites. However, I've seen a lot of cases where these spikes are scheduled quite late which leads to delayed data processing of their data. 

To avoid that, it's better to schedule your expected traffic spikes well in advance to avoid any data processing delays or issues. As an example, expected spikes above 25,000,000 server calls should be submitted one or more months in advance which gives Adobe enough time to allocate any necessary hardware. Here's a summary of how much lead time is needed by traffic volume.

So 
that's it! Hopefully you found some of these uncommon scenarios pertaining to Adobe Analytics helpful.

Wednesday, October 31, 2018

Adobe Experience Platform SDK Setup (iOS)

There were 178 billion apps (statista) downloaded in 2017. With that amount of volume, it'll be unthinkable for any major organization today to not have a mobile app that allows existing and potential customers to interact with its brand. Most Apps regardless of their purpose have some kind of analytics tracking embedded in them and one of the tracking solutions they leverage is Adobe Analytics.

Adobe Experience Platform SDK (informally known as SDK V5.0) was recently launched and it aims to give clients more flexibility around mobile SDK deployment as it leverages Launch by Adobe to publish changes in an external environment outside of the native app. This was not the case with the previous version v4 of the SDK. The reason why that's exciting is because any configuration changes to the SDK around Analytics can now be done in Launch without having to go through the App Store. There are other differences between the two versions which is covered in more detail here.

There are two primary methods to setup the AEP SDK which are either using CocoaPods or the manual method but in this post, I'll cover how to set this up manually. A lot more information is provided in the Mobile team's official documentation but my aim is to take their instructions and document it visually using my sandbox. I'm covering two main components of this setup which leverage Launch by Adobe and XCode (V10) to setup the SDK.



Launch by Adobe Setup


This is a big enhancement of this SDK over V4.0 where we're now able to deploy the configuration library using Launch by Adobe as opposed to the ADBMobile.json config file that we have with V4.0. The primary advantage of this is that we're able to make basic configuration changes such as changing report suites, enabling/disabling tags, activating the Experience Cloud ID service etc. directly in Launch without having to go through the App Store. There will obviously be a need to publish the app at the start to the App Store to submit the app. Please note that we currently cannot setup any trackAction (clicks) or trackState (page views) calls in Launch and need to do that directly in the App so that does require us to to go through the App Store for each change. Let's go through the steps.
  • Create a mobile property in Launch and select the platform as Mobile.


  • We then setup extensions in Launch and by default, you should see two extensions already added called "Mobile Core" and "Profile" which are explained below. I'm not going to cover these in detail as we only need to add some basic details to the Mobile Core extension. Additionally, we also need to add the Adobe Analytics from the Catalog and install it. Let's review these extensions.
    • Mobile Core: This provides essential SDK related functionality as well as the library to deploy the Experience Visitor ID service
    • Profile: It stores user attributes on the client and more details can be found here
    • Adobe Analytics: It provides the Adobe Analytics library to the SDK. 

Add your tracking server

Add your report suite and tracking server
  • Once we've installed the extensions, we need to retrieve the iOS libraries that are accessible in the Environments section in Launch. This snippet contains a reference to libraries that need to be included in XCode to deploy the SDK (see below). 

  • Finally, we need to publish these extensions to either the development or production environment depending on the scenario. Note that you can also disable Analytics tags from the App by publishing it in Launch if required.

XCode Setup


Before diving in, I highly recommend that you review the steps outlined in Adobe's official documentation on configuring the SDK. Some of what I'll cover is outlined in the documentation but I'm including a lot more detail in the form of screenshots from XCode which the documentation doesn't include. So, let's continue.


  • Download XCode and setup a basic App which allows you to simulate an iOS App experience.


  • Download the AEP iOS SDK from Adobe Experience Platform's Github branch located here.


  • The downloaded zip contains a bunch of files and folders but the one we need to use is called "iOS" which contains two sub folders called "device-only" and "universal". 

  • The "iOS" folder needs to be added to XCode and mapped to the Target in XCode. Once the mapping is done, we need to add some frameworks to the "Embedded Libraries" section in XCode to provide the necessary libraries to the SDK. Please note that for an actual iOS Apps, you need to use the frameworks present in "device-only" but for Simulators (my use case), you need to use the frameworks present in the "universal" folder. I've tried to color code the relevant details in this screenshot.

  • Once the required frameworks are added, we need to reference all libraries and call specific methods to activate lifecycle calls, enable logging and other methods as explained here. I'm using Objective C but the documentation covers Swift and Android syntax as well. Please note that I copied the installation code directly from the Environments section in Launch (covered above) and included it in XCode which ties the SDK with Launch. I've included these methods in the AppDelegate.m file of my App. The integration with Launch is done via the configureWithAppID call to which we pass the Launch App/Environment ID.


  • Once the basic lifecycle tracking methods are added, we can add a trackState (page view) method call to trigger an event. I'm basically sending data to the "screenName" variable populated with a value of "homeview". That is typically done in the ViewController.m file.

  • Finally, we need to make sure that the App build is successful and test the Analytics call. In my case, I'm looking for the variable called "screenName" which is populating in the debugging console as shown below.

The Adobe Experience Platform SDK is still relatively new and is being evolved but the process of installing the SDK is fairly easy once you get through the initial learning curve. I will continue to keep track of all upcoming features and will write about other functionalities tied to Launch by Adobe to trigger different types of mobile events.

Sunday, July 15, 2018

iOS Mobile App Analytics Debugging

Back in 2008, I wrote about debugging web analytics code. Mobile App Analytics testing, on the other hand has always been a mixed bag for me. I've primarily leveraged Charles Proxy to setup a connection between my device and my computer outlined in the instructions here but I've never been able to set it up without a glitch. Given that I mostly use Apple devices, I'm going to cover how to test iOS Apps in this post.


Charles Proxy iOS App

The new Charles iOS App is a godsend if you're looking to validate Analytics calls on an iPhone or iPad. This App costs only $8.99 for a single device and the best thing about is the simple setup which is what makes it a steal in my opinion given all the time it'll save you in configuration. I highly recommend this app if you want to save yourself the hassle of setting up Charles proxy on your Mac or desktop as this App works both on 4G/LTE and Wifi. Note that this method is recommended when you want to test an App downloaded on your iOS device. Here's a link to the iTunes Store to buy it.

Below are some screenshots and a quick walkthrough of how to set it up on iOS.

  • Download the App and "Trust" the App by going to Settings -> General -> Profiles & Device Management on your iPhone.


  • Now that the app is successfully installed , let's take a look at how to set it up to start recording traffic. The first step is to toggle the Status option to "Active". You will see an icon showing "VPN" appear next the cellular and Wifi icons. Next, click on the Gear icon highlighted in Red to go into the Settings screen.


  • The next step is to click the "SSL Proxying" menu to enable SSL tracking which is a very important step. Install the SSL certificate to capture secure packets.


  • Now that the certificate is installed and proxying enabled, we'll have to enable SSL proxying for individual host names. Click the "Disable SSL Proxying" link and again click on the "Enable SSL Proxying" link to enable SSL tracking for a particular host name. You will have to restart the App for it to take effect.

  • You should end up with a list of all host names that will be displayed when you download the Charles log (covered in the next few bullets). You can also manually add hostnames by clicking on the "+" icon.

  • Once SSL proxying is enabled, let's take a look at how to review the logs by going to the main screen and clicking into the "CURRENT SESSION" menu. 

  • Once on this screen, filter for the host name you want to analyze as shown in the two screenshots.


  • You can now review the analytics request by clicking on the "View body" option under REQUEST BODY.

  • The issue with the Response header is that it's not easily legible so it makes sense to share the analytics requests by clicking on the icon highlighted in Green. To clear all requests, click on the icon highlighted in Red. Note that you can share the Charles session via Slack, email or text. This is now my preferred method of testing App analytics requests.


  • You can finally view the output in the desktop app for Charles proxy to see it more clearly as well as share it with others.

Enable Debugging in XCode

Finally, I highly recommend that you enable setDebugLogging in XCode to validate your test App for your own QA.




Please feel free to share other tools or methods by which you perform your own mobile App validation.