Solved

Google Analytics Measurement Protocol App/Screen tracking response GIF89a

Posted on 2014-12-07
12
824 Views
Last Modified: 2016-02-24
Hi All,

I am trying to implement screen tracking using the measurement protocol for the first time and I get the following response back from Google when performing a HTTP GET request:

GIF89a�����,D;

My GET requests are as follows:

v=1&tid=UA-57396443-1&cid=1234&an=Mobile+app&av=1.0.0&aid=com.myenterprise.myApp&t=screenview&cd=TitlePage&qt=193298751&sc=start&z=8501202

v=1&tid=UA-57396443-1&cid=1234&an=Mobile+app&av=1.0.0&aid=com.myenterprise.myApp&t=screenview&cd=Intro1&qt=193267065&z=1953001

v=1&tid=UA-57396443-1&cid=1234&an=Mobile+app&av=1.0.0&aid=com.myenterprise.myApp&t=screenview&cd=TitlePage&qt=193257961&sc=end&z=9035286

As you can see, my parameters include:

v
tid
cid
an
av
aid
t
cd
qt
sc
z

Has anyone seen this response before. Am I missing a parameter or passing a malformed value?

Could it be related to my user agent information?... I am implementing this tracking into the HTML of a Hybrid iOS app (HTML5 and xcode wrapper). At this point I am testing the tracking in Chrome rather than it being built into an IPA so the user agent is:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36

.. Could Analytics be expecting a different user agent for the hit type screenview?

Thanks,

Rit
0
Comment
Question by:rito1
  • 6
  • 6
12 Comments
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 40485532
The response seems to be a gif image. So you have to use that parameterized URI as src of an image control.

It should be ok, just use it in the right context.

Bye, Olaf.
0
 
LVL 1

Author Comment

by:rito1
ID: 40486315
Hi Olaf,

I wasn't expecting a GIF back as the status and plus my page impressions are not appearing within the reports. This includes not showing in the real-time report either.

Do you have any other ideas what could be causing the issue with the payload I am sending?

Thanks,
Rit
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 40486324
Wait for a google analytics expert, but as the resonse you get begins with GIF89a, it is a gif image, there's no doubt about that.

You don't tell us what base URL you're using to send this paramaters or payload, as you call it.

Bye, Olaf.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Author Comment

by:rito1
ID: 40486429
0
 
LVL 29

Accepted Solution

by:
Olaf Doschke earned 500 total points
ID: 40486906
Seems like you misunderstand what to use this API for. You can use this in pages for measuring traffic and giving payload info. All the user get's is a 1x1 pixel gif, which is quite invisible.

This technique is also referred to as tracking pixel or web bug. See http://en.wikipedia.org/wiki/Web_bug

So if you want to get statistics, you're in the wrong API, this is for measuring and tracking your customers, for building and collecting statistics, not for retrieving statistic results.

Bye, Olaf.
0
 
LVL 1

Author Comment

by:rito1
ID: 40486978
Hi Olaf,

Thank you for your continued help.

As you can see from the type of data I am passing to Analytics, I want to capture screen impressions (not pages). Maybe its my misunderstanding but reading the overview of what the Measurement protocol is/does, this sounds right to me...

https://developers.google.com/analytics/devguides/collection/protocol/v1/ 

This is where I got me example payload data from which is part of the measurement protocol:

https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#screenView

How can I use this data for reporting?... what is the purpose of the measurement protocol otherwise?

If I want to be able to record screen impressions for my app that may be offline, so needs to be able to cache screen impressions and send them when a connection is available, what is the most appropriate approach?... I wanted to stay clear of using the iOS SDK to maintain my cross platform codebase.

Again, thank for you support.

Thanks,

Rit
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 40487055
Again, this request is for adding to your statistics, reporting is not done by this request. It also exists as PUT request and then you don't get back a 1x1 pixel. To use this as GET request is for web applications or browser apps.

Before you can report when and how often you get page impressions, it has to be recorded, doesn't it? And this is the API and request used to record the impressions.

Reporting of results is done somewhere else.

Bye, Olaf.
0
 
LVL 1

Author Comment

by:rito1
ID: 40487104
Hi Olaf,

If I change it to a POST or PUT instead, I get a 405 method not allowed error. This is why I used the GET method. The GET method is allowed for recording the payload according to their docs:

https://developers.google.com/analytics/devguides/collection/protocol/v1/reference - within the Transport section titled 'GET'.

It might be, like you say, that the GET method returns a gif rather than the expected '2xx' status.

It doesn't seem to explain why I cannot see any screen impressions within the Analytics reporting interface.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 40487238
The docs say the GET request is available for situations you can't do a PUT request, that's fine.

The status is part of the response, but it's not in the response body. I don't know in what programming language you develop, but typically a http request has a response object with a response body (the GIF in this case), response headers plus some other properties, like the response status. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html

Bye, Olaf.
0
 
LVL 1

Author Comment

by:rito1
ID: 40488814
Hey Olaf, it works!... There seemed to be a delay in my Analytic account becoming active. I am ignoring the fact that its returning a gif... I can deal with then :-)
0
 
LVL 1

Author Closing Comment

by:rito1
ID: 40488815
Thank for your support.
0
 
LVL 29

Expert Comment

by:Olaf Doschke
ID: 40488858
You're welcome. As far as I googled xcode/objectiveC has a response class able to give you the statuscode.
The only time it would really matter is, if you want to repeat the request, wehen it fails from some client.

But yes, a GET request, whether used in an img html tag or a javascript xmlhttprequest or in any app code will return a 1x1 gif and you can also simply ignore it.

Bye, Olaf.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn about the eCommerce marketing trends for the year ahead.
This article was initially published on Monitis Blog, you can read it here . When it comes to deciding which approach to website performance monitoring is best for your business, unfortunately, like so many options in life . . . it depends. In t…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question