Mithun Shreevatsa
Mithun Shreevatsa

Reputation: 3629

Measurement protocol Usage

I am completely new to the Google Analytics Measurement protocol.

Trying to fetch the results and load it in iframe of an registered tid domain.

My query string looks something like this:

http://www.google-analytics.com/collect?v=1&tid=UA-XXX-1&cid=555&t=pageview&dp=%2Fauth"

But i get the response as : GIF89aÿÿÿÿ,D;

What am I doing anything wrong? I also tried passing domain name with it and its title. Still no success.

And also do I need to call this get or post from the origin domain or can I do it from Postman-Rest client?

Upvotes: 2

Views: 719

Answers (2)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 117321

I think your having an issue with understanding what the Measurement Protocol is.

You said:

Trying to fetch the results and load it in iframe of an registered tid domain.

What the measurement protocol is for:

Measurement Protocol Overview The Google Analytics Measurement Protocol allows developers to make HTTP requests to send raw user interaction data directly to Google Analytics servers.

The measurement protocol is for sending hits to Google Analytics, If you want to get your Google Analytics data out you use the Reporting API

Response

The response you are getting back from the measurement protocol is good it means it recorded your message. GIF89aÿÿÿÿ,D;

Upvotes: 3

dorian
dorian

Reputation: 6292

What you're seeing is the content of the 1x1 GIF pixel that Google Analytics uses, which you can safely ignore. As long as the response code of your request is 200, you should be fine.

The origin domain of the request doesn't matter; you can—for instance—also send Measurement protocol requests from server-side scripts and it still works.

Upvotes: 1

Related Questions