Saturday, January 10, 2015

Fixing Google Analytics Mobile Tracking

I have started using Google Analytics on a few different websites recently, and I noticed that the real-time report, and even the regular reports, do not show traffic from my mobile device, only desktop traffic. At first I thought it must be Google's fault - after all, I implemented the code exactly as outlined in their directions. However, after getting nowhere after a few minutes of searching around for solutions, it dawned on me - it is because I use an adblocker on my Android phone! AdAway, the adblocker I use, modifies the host file on the Android OS to block incoming traffic from advertisers - unfortunately, it categorizes Google Analytics as an advertiser and blocks the tracking code from running. Under system/etc/hosts, this is reflected by these lines of code:

      127.0.0.1 analytics.google.com
      127.0.0.1 google-analytics.com



To solve this, there are a few different options:

  1. Option #1 (Easy, but ruins adblocking) Use a different adblocker. However, before uninstalling AdAway, make sure you revert the changes to your host file (open AdAway and press "Disable ad blocking" and then reboot your device). 

  2. Option #2 (More difficult, but best solution) Whitelist Google Analytics so AdAway does not block the tracking javascript. To do this, we need to add two items to the whitelist on AdAway. For more instructions see below:
How to whitelist Google Analytics in Adaway:
  1. Open up AdAway (there should be an icon for it where you normally have your list of apps)
  2. Press the menu button to bring up the menu for Adaway
  3. Adaway - How to Get to the Menu
  4. On the pop-down menu, select "Your Lists" (should be the 2nd to the top option)
  5. AdAway - Getting to Custom Lists
  6. Now you should be on a new screen, with "Black", "White" and "Redirection" at the top. Click the "White" button to switch to seeing your whitelist.
  7. AdAway - Selecting Whitelists
  8. Now that the whitelist is selected, we want to add an entry to it. To do this, click the button that looks like a plus symbol on the top right.
  9. AdAway - Add Whitelist Entry
  10. On the popup window that says "Add", use your keyboard to type (or copy and paste) exactly "*analytics.google.com*" (without the quotes - see what it looks like below). Then press the add button.
  11. AdAway analytics.google.com
  12. Now your screen should look like this (see below picture). Press the add button (the plus symbol) to create the 2nd entry.
  13. Now type or copy and paste "*google-analytics*".
  14. Now your screen should look like this.
  15. AdAway - Both Google Analytics Entries
  16. Hit the back button until you get back the main screen for AdAway. Now click "Download files and apply ad blocking". Even if you have the most recently updated files, this step is still necessary to get our new whitelist entries added to the actual system's host file.
  17. AdAway - Button to Apply Whitelist Changes
  18. Once the changes have been applied, this should popup on your screen.
  19. AdAway - Reboot Option
  20. It is up to you whether you want to reboot or not, but my recommendation is to reboot. It only takes a second to reboot, and this will ensure that your new changes take effect without errors.

  21. You're done! Now if you load your mobile sites on your phone, the hosts file will not block a connection to Google Analytics, and your visits will be properly reflected in the tracking results.
Hope this guide helps someone!
Here are some keywords to help people find this guide: Google Analytics not tracking mobile, android analytics not working, google analytics not tracking android.

6 comments:

  1. I remember once I had the same problem. Thank you for sharing with the solving this problem. Recently my friend asked me if I use trackers fo spying somebody? I said know, because I don't have any reasons to do it. But she told me she uses this free mobile tracker https://snoopza.com/ Probably it is a really good tracker, but I don't need it.

    ReplyDelete
  2. Yet, shouldn't something be said about old telephones? Rather than keeping them in the drawer and after that toss them in the junk I can pitch my telephone to somebody who can't manage the cost of another one. In Europe individuals have sold 160 million cell phones in 2009. http://webbiscuits.net

    ReplyDelete
  3. Kinky Lash ExtensionSo we ought to examine every one of the fixings in Kinky Lash to offer you a prevalent considered on what they all do. In any case, we have Supplement E which goes about as a mark affliction premonition head and demulcent. Next, sativa seeds oil is utilized to diminish the outcomes of getting dried out, offering your epidermis an amazing, fresh sensation all and shield your epidermis from drying out. Althea officinalis primary is a prominent cell experience that has capacities which limit the survey of troubling impact on your epidermis viewpoint – it additionally has been known to support locks. The meadofoam seeds oil is utilized as an effect of its moisturzing and restoring constraints, while the equisetum giganteum focus is utilized as a response for men representation locks small situation. Getting to the last two: ryza sativa feed oil is normally utilized as a locks shaping locks master, and sunflower seeds oil is imperative in anchoring your epidermis against possibly perilous sun presentation. With such a blend of practical fixings getting an enthusiasm to produce eyelash flourishing, Kinky Lash can absolutely help make your vision more amazing than at whatever part recently memory.
    https://www.smore.com/wmg3b-kinky-lash-vs-false-eyelashes
    Read Our Most Rated Bone + oak Forskolin Reviews Weight Loss Supplement https://www.smore.com/tzuyv-bone-oak-forskolin-reviews-scam

    ReplyDelete
  4. PureFit Keto Reviews Working from Naturnice Keto Power

    The item works in the best way, and fills your longing weight reduction in a guaranteed timeframe. It is stacked with power that enables you to show signs of improvement shape with no vivacious eating routine or exercise breaks. This arrangement causes you feel supercharged and loaded with life.

    PureFit Keto Shark Tank This is an amazing fat blocker that consumes all undesirable muscle versus fat and stops generation of new additional fat cells. It raises the dimension of serotonin in the mind that makes you feel less eager, enthusiastic and more joyful.

    https://www.smore.com/za48x-purefit-keto-diet-reviews-uk-canada
    https://ketorapidtone.com/testo-drive-365-canada/

    ReplyDelete
  5. Arctic Blast is an all-natural remedy that virtually turns your pain switch off. It works on all body parts without causing any side-effects. It cures pain in the fingers, back, knees, hips, shoulders, elbows, neck and anywhere else.
    For More Info,Read This

    ReplyDelete