Is it possible to send data to Google Analytics service by url? - google-analytics

I've been trying to send data to Google Analytics through url, but it's not working.
Here is the url:
http://www.google-analytics.com/__utm.gif?utmac=MY-UA
&utmn=0.57942900+13058623924dd5e0f88d784
&utmp=%2Fmypage.html
&utmr=http%3A%2F%2Fpp.test%2Fmypage-ref.html
&utmdt=test+ga&utmul=en-us
&utmhn=pp.test
&utmcc=__utmz%3D1.1304060743.1.1.utmcsr%3D%28direct%29%7Cutmccn%3D%28direct%29%7Cutmcmd%3D%28none%29%3B+__utma%3D1.100229728.1304060743.1304060743.1304060743.1%3B+__utmz%3D185677488.1304391672.1.1.utmcsr%3D%28direct%29%7Cutmccn%3D%28direct%29%7Cutmcmd%3D%28none%29%3B+__utma%3D185677488.2126025763.1304391672.1304667350.1305106191.6%3B+PHPSESSID%3Dpghin7v4q3g5lssq5c5mjchfj6
&utmcn=1
&utmcr=1
&utmwv=1
&utmsr=1280x1024
&utmsc=32-bit
&utmcs=-
&utmje=0
I have been trying follow the parameter here http://code.google.com/apis/analytics/docs/concepts/gaConceptsOverview.html
I call the url by curl and tested through the address bar, but not working, no data in my Google Analytics :(
Any ideas please?

It's possible, although if you're trying to do it you're probably doing something wrong.
But there's more to it than you can see at first sight. The best way to achieve it is to use a mobile library for Google Analytics. Google already provides this for a couple of languages. These libraries are built to send data to Google Analytics via your server. And if you check the server code you'll see that there are some calculations involved. You can possibly change one of these libraries to be run without a request. They're not complicated.
http://code.google.com/mobile/analytics/docs/web/

Related

Need a better solution than google analytics for data visualization dashboard

I trying to find a better solution than google analytics to create dashboards for visually representing custom data.
My use case is that I need something to track and record custom data that is not passed in through custom web events into google analytics.
I was able to find a hacky solution to the problem initially by running a periodic function over my data on firebase and sending it as custom events to google-analytics. (I mention the approach in this answer. The linked blog post gives further details.)
The problem that I faced was that it wasn't always reliable as although the function did run successfully every day, the data was not shown in the google analytics dashboard.
The data I to visualize is gathered as further insights by writing basic code on existing data
I am aware that it is possible to integrate google analytics for various use cases like even the smallest button click, but I am trying to either send custom events( raised outside of the application by running cron jobs or scheduled functions ) through some API call or maybe directly save and update the data in some other place where there is direct access to visualization
Does anyone know a better solution?
The Google Analytics Measurement Protocol allows developers to make HTTP requests to send raw user interaction data directly to Google Analytics servers, so you can use it to send your data generate outside your application:
https://developers.google.com/analytics/devguides/collection/protocol/v1

Is there any API call or any kind of feedback to know whether data is actually sent through google analytics collect endpoint?

I have settled my google tag manager as from the guide.
I have got in place a page that redirect just after the tag gtm-load is collected into the dataLayer. It's actually a "transition" page that should redirect instantaneously.
In this way I make sure google-analytics.com/r/collect is called, as I can see from the network ta of my browser, seems the only way to do so for an "instant redirect page".
However I need to test it from the back-end side.
Is there any way to have a feedback from Google Analytics about the data is actually sent? For example something like google-analytics.com/get/data/lastEntry, so that I can use a restAPI to check it out?
As far as I know, google analytics provide only metrics through a web page, and no actual data sent to.
Moreover there are some Rest API here but they are only for configuration purpose.
you might pass a JavaScript function as a hitCallback parameter of analytics send command and it will be called right after hit data were sent:
https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#hitCallback
Here's an example of how to use it with GTM alongside another useful feature of eventcallback
https://www.simoahava.com/gtm-tips/hitcallback-eventcallback/
Hope this helps.
There is a realtime API in Google Analytics, so what I have done for testing is to call my test URL with utm campaign parameters attached. Then I made a call to the realtime API and filtered by my custom campaign.
The realtime API is fairly limited (no session based values, obviously, you cannot test custom dimensions etc), but at least this tells you if your hit has registered in GA.

How can I use Google Analytics without its gtag.js library

I am having some pages where I need to track page views and get data for reports. So I need to use some tracking events without using gtag.js.
I have tried solutions like GIF Request Parameters
But this solution was there in ga.js and its a legacy
The format used in your linked documentation is deprecated since Google introduced Universal Analytics in 2012.
However the current solution to send requests to Googke Analytics without a library, the Measurement Protocol, works broadly the same way. You have an endpoint (google-analytics.com/collect) and add the necessary parameters as described in the reference, depending on what kind of interaction you want to track. The endpoint returns a 200 http status and a gif (no matter if the request has actually been logged in analytics, this just confirms that you actually hit the server).

Is there a way to track/record via Google Analytics visitors that visit my site via Flipboard?

I've been sniffing through my Apache log files and noticed hits which mention
FlipboardProxy/1.1; +http://flipboard.com/browserproxy
Is there a way to track/ID these users via Google Analytics so that I can understand what percentage of my visits are via Flipboard?
From what i read on flipboard:
Flipboard uses a proxy service to fetch, validate, and prepare certain
elements of websites for presentation through the Flipboard
Application.
Retrieving parts of your website to present it in flipboar, they are not actually real visits to your site.
But if you still want to track those requests in analytics then you would need to write a php that sniffs user agent and trigger a gif request to analytics.
IF they're not showing up in the Browser & OS Report; they're probably not running javascript and/or block GA.
Something along those lines might end up here. Right now it shows data at a snapshot only though.
http://ripl.io/flipboard-analytics/

What is utmu parameter in google analytics __utm.gif request?

I am trying to make the google analytic __utm.gif request using php. I have broken all the variables and the only one which I don't know about is utmu parameter. It is not documented anywhere.
When I see a pageview tracking request it is appended to the end of request as &utmu=qB~
While doing ecommerce tracking it is appended as &utmu=qBAL~
Please help me with this.
It is a bitmap of all of the methods used to build the request.
Source: http://glucik.blogspot.com/2011/02/utmu-google-analytics-request-parameter.html
utmu doesn't actually contain anything of external meaning. Google uses it to store some internal values that help them improve ga.js. It's not required to make any functionality work, so, your PHP code doesn't need to account for it.
However, you should know there are already a few long-standing PHP-based Google Analytics projects, like Server Side Google Analytics (SSGA), as well as the semi-official Google Analytics for Mobile PHP and PHPGA.

Resources