Showing posts with label QA. Show all posts
Showing posts with label QA. Show all posts

Saturday, December 1, 2018

Reasons For Data Variance Between Analytics Systems

I'm almost certain that at some point in your career, you've been asked to troubleshoot an age old problem of comparing numbers between different analytics systems. I have been asked about this (several times!) so I'm writing this post to share what in my experience, are some of the reasons for this difference and also some potential ways to close these gaps. I will talk about a recent experience I had with a client and talk about some of the issues we faced and a potential solution the team is evaluating. 

Based on a few comments I got about it to not pursue this type of analysis and only look at trends, I want to clarify that we did that and the trends did not line up in this case. We all know that no two systems are going to be the same but in such a scenario, you do need a way to validate your orders to establish the web analytics tool as the ultimate source of truth. That can only be done by going through this painful exercise at least once which happened to be this time when I was first looped into this project. 


The Challenge and Context


My client reported a 25% variance between eCommerce orders reported on the website and their backend system where the website was lower. The issue started after they redesigned the UI (Single Page App) and updated the backend platform. The difference was caught about 2 weeks after the new UI went live. We had used DTM to slightly revamp the implementation to add additional attributes and asked the platform development team to fire a Direct Call Rule (same as before) on the confirmation page which was already in place in the previous version. 

The client wanted us to come up with a solution to 'backfill' these historical missing orders in Adobe Analytics and also apply the right kind of marketing attribution to them which was always going to be challenging as time had already passed. The basic issue is that once a Visitor ID has had been to the site and visited a bunch of pages and certain eVars were set, backfilling data for that user would ‘break’ the pathing flow, the visitor profile and any downstream conversion metrics would also be messed up. This Adobe article on timestamps explains the issue better than I did.

What is an Acceptable Variance between Systems?


Honestly, the answer to that question depends on the client, system and the metric we're looking at. If we're looking at deduplicated metrics such as Visits, Visitors or even Orders, then anything below 5% is acceptable in my experience. For duplicated metrics such as Page Views or Clicks, I've seen clients accept anything below 10-15% if we're comparing one client side system (Adobe Analytics) with a backend CRM system (my use case). 

The other thing to note is that if we're comparing Adobe Analytics to Google Analytics or any other web analytics system, then a lower variance should be expected. Keep in mind that both client side solutions should fire as close to each other as possible on the page to expect a low variance.

Analysis and Approach to Pinpoint the Variance 


During the course of the investigation, we looked into the following factors that could've contributed to the variance. 

But before we begin, make sure you download records from both systems that should be from the same time frame, time zone and need to have the same dimensions and filters as much as possible. We know that no two systems will be apples to apples but let's make sure the comparison files are as close to each other in all respects. Let's now take a look at some of the factors we looked at keeping the orders metric in mind in comparing a web analytics solution such as Adobe Analytics vs. a backend CRM system.
  • If you're not tracking all the payment methods in one system vs. the other system, you will see some discrepancy in the overall orders.
  • There may be conflicting JavaScript code deployed on the confirmation pages (privacy, plug-ins etc.) that will not be compatible with scripts used by other payment methods or Analytics tags. This was actually one of the causes of the difference.
  • Legacy Browsers may not run JavaScript tags so that is another cause of the variance.
  • There may be internal IP filters or bot filters that are applied at the web analytic tool level that won't be present in the CRM system so that is another reason.
  • Given that our Direct Call rule was firing at least 8-10 other marketing tags including Google Analytics, we thought that in some cases, Adobe Analytics didn't fire because of that so try to limit the number of tags on key pages such as confirmation.
  • Most important is the order of execution of the Adobe Analytics tag and if it's able to successfully grab all elements present in the data layer. In our case, we noticed that Adobe Analytics was not able to grab elements from the data layer 100% of the time.

What was the Root Cause of the Variance?


The main reason for the variance was that the website did not fire the Direct Call Rule in DTM required to track the orders 100% of the time in Adobe whereas the CRM system always captured the order if it was a successful submission. We were able to nail this down when we looked at the orders in Google Analytics which ALSO reported a 25% variance between the CRM system.

Potential Solutions to Backfill Missing Traffic


Partial- Data Insertion API


Data Insertion API is a very well known and common methodology to send data to Adobe Analytics server side. In this case, we tried to leverage this method to backfill historical orders and it worked but the other requirement around marketing channel attribution could not be met by this method. If your client also wants to fix the marketing channel attribution problem, this method is not going to work.

Regardless, I still want to quickly cover how we went about testing some orders using Postman to send a POST request to Adobe Analytics. The following screenshot shows a sample XML request to send historical order to Analytics. Note that we need to pass an epoch based timestamp which is a required field to backfill historical or any data.


Complete- Data Reprocessing


I don't have much experience with this but based on what I've heard, a custom consulting engagement with Adobe's engineering team to reprocess the data can fix the attribution issue. This is still being evaluated and I will provide an update when we're done with the project.

How Can We Avoid Issues Like This?


The only way to avoid such issues in the future is to thoroughly test this in a development environment before anything goes to production. A similar kind of rigor is needed to test key metrics in a test environment similar to how it is in a production environment especially during major redesigns so that we nip it in the bud at the onset. The other thing that you can do on an ongoing basis is create anomaly detection dashboards in Adobe Analytics or other tools that are designed to catch any noticeable drops or inflations. I know there are other ways to avoid issues but that is a separate blog post in itself.

My hope with the post is that I'm able to help you find some reasons around why traffic is different between systems on how to be better prepared while undertaking such a task. I wrote about something similar way back in 2007 when I started my career that might be relevant. Have you run into a similar issue for your clients?

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.

Tuesday, June 16, 2009

Web Analytics Implementation Process

Web Analytics in an organization should be just like a development cycle starting from requirement gathering to validation. Below is a visualization of an ideal Web Analytics process. This process is more suited for tech organizations which already have defined KPIs and regular weekly/monthly releases of new features on their website.



1) Requirement Gathering: This is the start of the Web Analytics process and it deals with an Analyst collecting tracking requirements from stakeholders. Similarly this step will also involve review of feature specifications of new items that are part of a release cycle. An example of a new feature can be a new page being added on the website or a new outgoing/external link being added or even an A/B Test.

2) Creating a Tracking plan: Once all the requirements have been gauged, the Analyst will create a Tracking Plan/Analytics plan/Solution Design document to define the variables for Web Analytics vendor tools (custom variables, pagename variables etc) like Omniture SiteCatalyst, WebTrends, Clicktracks or Google Analytics. This is usually an excel document containing a matrix of all the variables and their corresponding values.

3) Development: In this step, the Analyst will usually work along side a developer to get the features implemented on the website. This step also requires the Analyst to assist the developer with any questions she has regarding the Web Analytics code or the Tracking plan. This applies especially to new developers who do not understand the Web Analytics snippet.

4) Data Validation: This step deals with the QA/testing of Web Analytics data that land up in the Web Analytics tool. I have written a comprehensive article detailing the importance of this step as this in itself is a separate process.

5) Reporting/Analysis/Recommendations/Next Steps: After the data is found to be clean, it is the responsibility of the Analyst to report numbers resulting from the feature which went live during the previous release cycle. The Analyst will also provide analysis (explaining the data or conversion etc) and possible recommendations/next steps to improve the website even more.

This, according to me is an ideal end to end process which organizations should be following to manage Web Analytics. It is vital for a big organization to incorporate these steps in their overall plan for Web Analytics to ensure smooth functioning.

Thursday, April 2, 2009

My take on Web Analytics Testing/Quality Assurance

When we discuss Web Analytics, we talk about Implementation, Reporting/Analysis and offering recommendations on how to improve a website. QA/Testing is something which is often put in the backburner. Companies focus on the Analysis of data but don’t usually concentrate on the validity of data. This often leads to reimplementation of code and the data being inaccurate. This is not good news for companies tagging their website with Web Analytics code and paying for Implementation and Analysis. This article at a high level explains some of the things which may help improve the Web Analytics QA process of organizations. These are some of the points which can be useful for Web Analysts looking to setup a Web Analytics QA process.

1) Spread the word: Spread awareness about Web Analytics QA benefits to your Manager/Stakeholders specifying how thorough Web Analytics QA can help them save cost in the future. For e.g. you can tell them that proper Web Analytics of the code/data can help companies reduce repetitive fixes/patches of code or resultant skewness of numbers while performing Analysis.
2) Include in release cycles: Try to incorporate Web Analytics QA in the weekly/monthly release cycles by bringing into perspective all stakeholders from QA Analysts, Developers to Program/Project Managers. It might involve lot of patience, persistence and convincing but it is worth the time. Come up with a process document/Flow chart depicting the QA process and share it with the concerned teams.
3) Performing QA/Knowledge Transfer: Once the Web Analytics QA process has been approved, start off by performing QA yourself and transition this responsibility to the resident QA Analysts as a Web Analyst should be involved more with Analysis/client interaction etc. Sharing tutorials about different Web Analytics tools might be helpful to pass on to the QA Analyst.
4) Create a reusable test document: Once the training has been imparted, the QA Analyst or Web Analyst can create a test document to perform Web Analytics testing. The QA document should leverage a Packet Sniffer (explained in my previous article) and should also validate data in the Web Analytics tool. For e.g. the below screenshot makes use of conditional formatting to color incorrect values (not matching requirement) as Red and correct values as green. This is a screenshot taken from a QA document which I created in one of my assignments where we were QA’ing Omniture data. This document helps in validating the code as well as checking the output and should be reusable.



Hope you like this post. Please comment in case you agree/disagree with my analogy about Web Analytics QA process being an integral part of a Web Analytics assignment.

Sunday, February 10, 2008

Debugging your Web Analytics Code

I came across a question on Yahoo Web Analytic Group regarding debugging tracking code on a webpage without having access to the Web Analytics tool. The answers to this question can be more than one but based on my experience, the best way to check Web Analytics code on a page is to use a Packet Sniffer.

A Packet Sniffer or HTTP/JavaScript Debugger as it is known is a tool that analyzes and parses network traffic. There are many other uses of a Packet Sniffer but in this case we are only looking at capturing HTTP/JavaScript packets. So if I have a webpage containing Google Analytics code, all I need to do is activate this software while the webpage is being loaded. Once the entire code snippet on the page has been loaded, you can go to the Packet Sniffer tool and search for the Google Analytics code from the list of captured packets.

Let us look at an example by going to www.msn.com and capturing the Omniture Web Analytics tag on their webpage using a tool called Fiddler. Please look at the 2 screenshots captured after the MSN-US page load was complete.


The first image is an overall summary of all the code being rendered with the Omniture code highlighted in Blue. Please note that for an Analytics JavaScript code to be successfully rendered, it has to make a ‘Status 200' call to the respective Datacenter meaning the request has been completed. Now double click on the captured snippet and look at the second screenshot for the next step.


After double clicking on the Omniture code, you will have to click on the Web Forms tab on the top right in order to view the various parameters being passed onto Omniture. You will notice all the various parameters being sent to Omniture like the Page name, Language, Screen resolution and so on. This step will also tell us whether the custom variables we passed on the analytics code are being sent correctly or not.

Packet Sniffers have a very important role to play in Web Analytics as they can help fix issues like data not being present in the reports to discrepancy in numbers. Finally listed below are a few more HTTP Debugger tools that I’m aware of:

1) Adobe Experience Cloud Debugger
2) Charles Proxy
3) Debugger for Adobe Analytics