Google Analytics Measurement Protocol App/Screen tracking response GIF89a

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
LVL 1
rito1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Olaf DoschkeSoftware DeveloperCommented:
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
rito1Author Commented:
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
Olaf DoschkeSoftware DeveloperCommented:
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
Get Cisco Certified in IT Security

There’s a high demand for IT security experts and network administrators who can safeguard the data that individuals, corporations, and governments rely on every day. Pursue your B.S. in Network Operations and Security and gain the credentials you need for this high-growth field.

Olaf DoschkeSoftware DeveloperCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rito1Author Commented:
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
Olaf DoschkeSoftware DeveloperCommented:
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
rito1Author Commented:
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
Olaf DoschkeSoftware DeveloperCommented:
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
rito1Author Commented:
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
rito1Author Commented:
Thank for your support.
0
Olaf DoschkeSoftware DeveloperCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Internet Marketing

From novice to tech pro — start learning today.