Can a user have only non-interactive hits in Google Analytics - google-analytics

I want to test my script that send event to Google Analytics via Measurement Protocol. For testing I've created a new account and trying to send the following request using the following template:
http://www.google-analytics.com/collect?v=1&tid=UA-MY_TESTING_TRACKING_ID&cid=XXX&t=event&ec=AAA&ea=BBB&el=CCC&ni=1&z=123456
In Google Analytics reports on events I see nothing (no events at all as well as users and sessions). Now I am wondering if it is because my script is incorrect or because Google Analytics ignores non-interactive hits for users that have no previous "interactive" hits (i.e. hits without ni=1 parameters).
Does Google Analytics allows to see such users or each user must have at least one interactive hit?

I had, for a test, a couple of dozen hit send via curl on the command line, and they were being processed within minutes. CID had been randomly generated especially for the purpose. All hits where being sent with the non-interaction flag. Those were event hits like in the example from the original question.
I have seen those hits in the Behavior/Events report, so they are being properly collected. However "non-interaction" is to be taken quite literally, as they are not used in any session based metric - i.e. if you just send ni-events you will not generate sessions; if you send both interaction/non-interaction hits only the interaction hits will be used in session-based metrics. I am seeing a user count, so strictly speaking the answer to your question is yes, but number of sessions is displayed as zero (likewise for all related metrics).
Makes completely sense, but since the documentation (the last time I read it) talked only about bounce rates when it comes to non-interaction hits I did not think about it this way.

Related

Saving statistics to Google Analytics

I'm relatively new to Google Analytics and would like to have some inputs.
So I have a web application that people can install to create a backup and can do restores as well. The application has an API where you can see the statistics of the app i.e. number of backups made, restores made, and the number of clusters connected to this application.
Now I want to send these stats to google analytics with an interval of 10 minutes. I was wondering if I can send the status to Event with a unique UUID as Event Category, the backup/restores, or nodes as Event Labels and the number as Event Actions.
Is this the right approach to using Google Analytics Events? Or is there a better way to do it in GA? My requirement is I have to do it in GA or should I use a different hit type.
Given that we are talking API's you intend to use the Measurement Protocol?
And the UUID refers to the unique user? if so, you should look at the uid https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid
As to using Events versus Hits, using hits is probably easier on the reporting.

Google Ads / Analytics / Tag Manager: E-Commerce transaction not set in relation to Ad Click

We have a problem with E-Commerce transactions sometimes not beeing set in relation to an ad click ("cpc"). They appear instead with the Channel/Medium "direct". This is a problem as we cannot correctly link our revenue to the costs spend on Google Ads.
We got a payment system that allows buyers to safely pay to sellers, and we get a fee percentage of the payment volume (similar like PayPal). We get our fees as soon as a pay-in is successful. Because our users can pay via bank wire as well it may take one or two days until we actually get our fee. This is why ecommerce transactions are not sent from the frontend to GA (on a thank-you page like in online shops), but from our server directly to GA as soon as a payment succeeds.
This is the GET call our server does when a payment succeeds:
GET https://www.google-analytics.com/collect?v=1&tid=UA-XXXXXX-1&cid=1746XXXXX.1593XXXXXXX&t=transaction&ti=mytransactionID&tr=1&cu=USD
Here is a small diagram that explains the process:
We use cross-domain tracking, and the GA Client ID of the users stay the same when they get redirected from mydomain.com to app.mydomain.com, so this should not be the problem. What I assume is, that when a user clicks on an ad, the gclid of the ad is lost. Is there a way to manually send the gclid ID to Google Analytics? I would store the gclid then as well in our payment. Or is there another (maybe better way) to send transactions to GA?
Your transaction hit will only be attributed to ad-click session if payment occurs in a 30-minutes interval since the last hit with the same ID. Otherwise, the transaction hit would start a new session. Due to 'last-non-direct' rule the new session would only be associated with "cpc" channel if there were no other intermediate sessions after ad click. Please check the Google Analytics extensive overview for deeper insight.
Storing and passing gclid might help, however, this might result in some discrepancies in cost reporting since there would be several sessions for the same click. In the case of passing gclid it's recommended to pass at least two hits:
a simple pageview hit with a dummy location parameter containing gclid
and then later a transaction hit with the same location paraeter. In that case you'll be able to see your transactions as a separate sessions with a distinct landing pages
You should make sure you're using the GA client id in the Measurement protocol hit to ensure the hit gets stitched to the other hits of that user.
Now regarding reporting: Google Analytics uses the attribution model "Last non-direct Click", despite the hit being sent later, GA will ignore direct and use the previous touch point which should be the PPC campaign.
There shouldn't be an issue there. Which report are you using to see the transaction appear as direct, rather than Paid Search?

How to know if Google Analytics Property is going to exceed 10M Hit Limit? Other than checking on Google Analytics? Any API's given by Google?

I am using free version of GoogleTagManager and GoogleAnalytics for getting analytics my website. The free version of Google Analytics allows for up to 10 million hits per month, per property as per TOS.
We can check under settings section in GoogleAnalytics account as to what is the hit count in last day, last 7 days, and last month.
But, since that requires manual intervention that someone has to login to check; Is there a way to get to know what my current limit is for the month? So that if I am closer to breaching the limit we can disable GTM tracing.
Is it different for GTM?
There is no hit limit for GTM.
In Google Analytics, you could use the Reporting API to get monthly statistics, and then use the GTM API to pause the GA tags (which makes this somewhat on-topic).
The relevant metric would be ga:hit. This is not exact (it reports the hit volume of the view rather than the property) but should be "good enough" (as long as your view is not too heavily filtered; since a proper setup includes an unfiltered view in any case this would be a good candidate to get the number).
However you do not need to bother. If you exceed the limits then Google will warn you via email. You then have a few weeks to respond, and introduce sampling or other measures to bring down your hit count. Only if you ignore their warning they will terminate your account.

How can I get website analytics data of bots and users with no javascript and/or cookies?

Is it possible to get the info about website traffic without Google Analytics, for example?
For tracking without Javascript you can use the Measurement Protocol, i.e. you send a request to the Google Analytics Server with query parameter that specify the type of interaction (pageview, event etc) and the data you want to track.
General info is found in the protocol reference, a list of valid parameters is here, and if you want to test your tracking requests you can use the hit builder, which allows you to assemble, validate and send a hit to Google Analytics.
As for tracking without cookies that probably won't work very well. You need a persistent id to assemble hits into sessions, and sessions into visits. Such an ID is usually stored in a cookie (your "no javascript" requirement means that things like local storage are out of the question). You can either decorate all your links with a client id and use that to persist the parameter from page to page, or you use some sort of server-side browser fingerprinting.
All in all this might be somewhat less trivial than you assume, especially if you do not only want to track pageviews but also events that do not load a new page.

GA shows Bad Event Tracking Code message

since these days, Google Analytics start to show message "Bad Event Tracking Code" for several my projects. Even for one mobile app profile.
The message:
"The Landing Pages report has a (not set) entry. Verify that tracking code for property Mobilni Aplikace sends a _trackPageview hit and that it does this before sending any events."
I didn't change anything in these projects, so I don't understand what Google Analytics want.
Has somebody similar issue?
Thanks
Google Analytics just recently added a means of notifying you of problems so you didn't have to change anything to cause this issue. It could be preexisting.
EDIT: Solution 1 and 2 may help, but what worked was "Solution 3" -- Upgrade to Universal Analytics and increase session length.
Solution 1 - Send less tracking data
If the Google Analytics property is for a high traffic site without Google Analytics Premium you are limited to 10 million hits per month including events Data Limits - Analytics Help. In this case analytics may have recorded a user's event but the pageview was ignored to keep your account within limits.
If you could be flirting with this limit try sending less event tracking by reinventing or removing some event tracking entirely. If you are blatantly violating the data limits track only a subset of users by setting the Sample Rate in your analytics.js (or ga.js) code.
Solution 2 - Find the problematic event code
If you are not going over the data limits you have an event being sent before a pageview.
Methods of debugging "(not set) entry present in reports for property" are described on this page What the value (not set) means - Analytics Help.
Verifying this issue:
Go to the Analytics property with the issue and click Behavior reports > Site Content > Landing Pages
If you see landing page = (not set), this is generally due to a session with no page or screen view level hits included.
It’s possible to have a session that doesn’t include a page or a screen view, but does include another kind of interaction hit type, like an Events or Ecommerce hit type.
Debugging this issue:
Identify which hit type is causing the issue:
use the advanced filter (found at the top of the data table) to
restrict the data to include page/screen views matching exactly 0
For each of these 3 reports:
Behavior > Events
Acquisition > Social > Plugins
Conversions > Ecommerce reports
Note: The "page/screen views" dimension may have disappeared in advanced filters under those reports, I will update this answer when I find out more.
Solution 3 - Session is expiring before user leaves site
You can configure a visitor's session length for your property in Session Settings under Tracking Info.
The default length of time for a session or campaign. An individual session or campaign for a given user ends after the amount of time specified here has passed (counting from the start of the session or campaign), so long as the session or campaign has not been stopped though another means. Learn more about Learn more about session and campaign timeout handling.
If the user's session expires but they haven't left the page and another event triggers there will be no page view before the event has triggered. In this case your site would fall under this category:
The length of a session and campaign depends on your site and business. Here are a few ideas to get you started thinking about session and campaign timeouts:
Lengthen the session time if you have a lot of content and expect users to take a long time engaging with that content. Conversely, shorten the session time if the site has a small amount of content. 5
Increase the session length under Session Settings so these events will still have an associated pageview.
Note: You can only configure the session length if you're using Universal Analytics.
Google Analytics is currently in the process of migrating to a new operating system, the tracking code you have given in the comments appears to be the classic code. based on the information you have given in relation to your application, I believe you would be affected by phase 2 of the migration which has recently taken place
You can find a timeline of migrations along with instructions about how to upgrade your applications the the new analytics.js tracking code here:
https://developers.google.com/analytics/devguides/collection/upgrade/#phase-2

Resources