Have you ever been tasked to test your company’s (or client’s) analytic tracking in the app but never knew how to even start? Well I have great news of how to easily test it by following these simple steps.
Case 1: Adobe Omniture over HTTP
In this example, the development team have embedded Adobe Omniture tags for both click action and page views within an iOS app and we want to validate the output. For Omniture, these messages are sent over the HTTP protocol. These instructions also assume you are running Windows machine, though same technique should work on Apple OSX as well.
- Go to Fiddler2.com (NOTE: not fiddler.com, goes to a private web site 😉 ) and download the free web debugging tool. I am currently running Windows 10, so I chose the .Net 4 version.
- Run Fiddler. In my case it was not listed in my Start menu (woohoo for start menu coming back officially in Windows 10!!!!), but you can easily run it by going to run command (Win+R) and running fiddler.
- Now we need to configure it to listen to traffic from your phone. To do so, follow these steps
NOTE: For this to work, the phone must be running on Wifi, on the same subnet (router) as your computer.
- In Fiddler
- click on Tools -> Fiddler Options
- Select Connections
- Enter a unique Port. The default 8888 is an acceptable option but if multiple people are testing multiple devices in same network, you might want to change it.
- Additionally, we want to enable the option Allow remote computers to connect.
When you select Allow remote computer to connect, you will receive the following dialog:
- Click OK to the options window, close Fiddler and reopen.
- You will be prompted about a Firewall access request, select to allow access.
You have now configured fiddler, now, to configure your device. Before we do though, we need to get your computer’s current IP Address.
- Open Run command by hitting Win+R
- Enter CMD and hit run
- now type ipconfig in the command window.
- Many entries will appear, identify which connection you are currently using (wifi, ethernet…), basically whichever one has IPv4 Address populated and save the details for this entry –
- On your device (following is based on iOS)
- Go to Settings on your device
- Select WIFI
- On the WIFI network you are connected to (this must exist on same router/subnet as your computer you configured above), tap the blue i on the left side of the bar. This will open the detailed settings of your wifi network.
- Scroll to bottom of screen and tap Manual for the HTTP Proxy section of the screen. In the Server entry box, enter your IPv4 address you copied in an earlier step, and Port will be the entry you entered in Fiddler port configuration above.
- In Fiddler
Jump back to Fiddler and you should now begin seeing data entries displaying in Fiddler, these are from your phone.
Now that we have configured HTTP sniffer action, we now need to figure out how to read it.
- In Fiddler, you will notice many entries in the left frame –
- Notice the entries listed in blue above, with the Host = *.sc.omtrdc.net This is Adobe Omniture calls. Depending on your Omniture account, the Host URL could be slightly different.
- Tap on one of these entries, and on the right frame of the application, tap Inspectors then Web Forms. This will display the HTTP call in a more easily read table format.
- In this app example, we are making 2 types of calls to Omniture, Page View and Click Action. Both examples are shown below:
Filter to display only Omniture entries
In Fiddler, you can easily filter future results by applying a filter. To do so
- In right panel, click on Filters and select Use Filters at top of screen.
- In the second drop down under Hosts select Show only the following Hosts
- Enter your host your URL you identified above that calls Omniture in the box below the drop down.
- Click on a different entry in left frame to save.
- In the action bar, click the black X and select Remove All, this will reset the results pane and only show Omniture calls.
Case 2: How to receive HTTPS calls
In some (or many cases) a call is made using HTTPS, not HTTP (Google Analytics for example). To set this up, we need to perform additional steps to install a certificate on the device to decrypt HTTPS traffic. This is done by completing these steps – http://docs.telerik.com/fiddler/configure-fiddler/tasks/ConfigureForiOS