Tag Archives: testing

How to test Analytic tags (i.e. Omniture and Google) from Mobile Apps

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.

  1. 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.
  2. 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.
  3. 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.

    1. In Fiddler
      1. click on Tools -> Fiddler Options
      2. Select Connections
      3. 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.
      4. Additionally, we want to enable the option Allow remote computers to connect.
        Fiddler2ConfigWhen you select Allow remote computer to connect, you will receive the following dialog:
        warningaboutremoteconnectionClick OK
      5. Click OK to the options window, close Fiddler and reopen.
      6. You will be prompted about a Firewall access request, select to allow access.
        firewallaccessrequestYou have now configured fiddler, now, to configure your device. Before we do though, we need to get your computer’s current IP Address.
      7. Open Run command by hitting Win+R
      8. Enter CMD and hit run
      9. now type ipconfig in the command window.
      10. 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 –
        iPAddresslocation
    2. On your device (following is based on iOS)
      1. Go to Settings on your device
      2. Select WIFI
      3. 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.
        NetworkSettings
      4. 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.
        HTTPS2

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.

  1. In Fiddler, you will notice many entries in the left frame –
    FidlerResults1
  2. 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.
    OmnitureResutls1
  3. 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.
    WebView1
  4. In this app example, we are making 2 types of calls to Omniture, Page View and Click Action. Both examples are shown below:

    Page View
    PageName
    Click Action
    ClickActionsteps

Filter to display only Omniture entries

In Fiddler, you can easily filter future results by applying a filter. To do so

  1. In right panel, click on Filters and select Use Filters at top of screen.
  2. In the second drop down under Hosts select Show only the following Hosts
    FilterHeaderselection
  3. Enter your host your URL you identified above that calls Omniture in the box below the drop down.
    HostsURLsave
  4. Click on a different entry in left frame to save.
  5. In the action bar, click the black X and select Remove All, this will reset the results pane and only show Omniture calls.
    ClearResults

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