Prolem with assigning transactions to the users in Google Analytics - google-analytics

We are using google analytics for tracking the users and revenues.
Our revenues arrive in batches usually 24-48 hours after the session.
We are using the batch API:
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#batch
with the transaction hit type:
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#ecom
We are setting properly (at least we think so) all the parameters:
Example:
v=1&tid=TRACKING_ID&cid=CLIENT_ID&t=transaction&tr=EARNINGS_IN_USD&dl=USER_URL
We are currently facing following problems:
almost all our incomes (like 99.8%) are assigned to the returning users (when you look at the tracking data we have < 40% of returning users)
almost all our incomes are assigned to the users with landing page not set
What can be causing that? Why the transactions are not joined with sessions?

The cause of this is how Google Analytics understands and processes sessions. For example, a group of hits (HTTP requests to www.google-analytics.com/../collect) sent by JS code while the visitor interacts with your site within some reasonable time range is considered a session. When a user interacts with your site the next day a new bunch of hits are sent and these hits are processed as a separate session. So when you're sending transaction data in 24-48 hours after the time user last interacted with your site this will create a new session. Since there was a user visit before a transaction data were sent a newly created session is reported as a session of the returning user. In the same manner, since there's no page path / document location parameter in your transaction data this newly created session would have (not set) as a landing page.
Check the documentation for more insights.

Related

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?

Google analytics sessions and wordpress site

In google analytics my site have 27000+ users weekly, and 52000+ session. which is around 1.8 page view/session. There is no authentication sessions, like sign in etc, website is in word press. I want to know when user enter in site and view a page it will be considered as 1 session, but if same user lets say open page after some time then will it be new session or old?
I am using W3 Total cache and in browser cache expires header lifetime is set to 3600 seconds. Is this time related to sessions. Default word press session for login users is 48 hours, but in my scenario its anonymous user.
In google analytic definition about session is "Its the period time user is actively engaged with site".
Please advise
Google Analytics has very limited information about what happens on your site. It will receive data whenever someone loads a page, and possibly when an event takes place (but only if you've set that up).
It is not informed when a user does any of the following:
Closes the tab or browser.
Shuts down their PC.
Follows a link out of your website.
You could rip out the power cord of your PC mid-browse, then turn it back on. If you picked up where you left off, Google would have no way of distinguishing that from you refreshing the page.
As such, Google Analytics has to to approximate the end of each Session, with a set of rules based on the information it does have. Google will consider a session over when:
There has been no interaction for 30 minutes (this timeout can be adjusted).
Midnight happens (This is mainly to keep the data neat. Time Zone is defined in the settings).
A new Session is created with a different Source, Medium or Campaign (so if you leave the site and return via a different route, this is for attribution).
Whenever you land on a site, Google Analytics perks up and takes notice. It then waits faithfully for your next hit. If you come back looking different, it'll close your old Session and start a new one. At midnight, it'll close all Sessions for everyone. Otherwise, it'll wait faithfully for up to 30 minutes. If you interact in that time, it'll excitedly update your Session and reset the 30 minute clock.
Incidentally, that's also how time on site is calculated. On your first hit, your Session is assigned 0 seconds time on site. If you interact again, that time is updated to match the time between the two hits. When your Session is closed, its final time on site is whatever the value was at the moment it was closed, so Bounces have a time on site of 0.

Can a user have only non-interactive hits in 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.

Google Analytics Missing Some Event Actions (Recorded in Real Time but not in Behavior)

I am using the Google Analytics Measurement Protocol to send events, there is one category and several actions. There are currently a couple dozen GA Accounts that I am sending data to (successfully) but there's one that's experiencing very bizarre behavior.
Only one action is ever being logged for this account under Behavior -> Events, but the other two (missing) actions are shown under real time. The account is using UA and the session timeout is set to 30 minutes. The first action is typically sent several minutes before the next actions.
I can verify that the requests for other actions are being sent with 200-responses. There also appears to be no filter for the missing actions or anything else that would prevent them from showing.
There is a conversion involving the missing actions and when attempting to do a verify I do get a non-zero conversion rate.
Any direction would be appreciated.
Edit: The data collection has been running for a month.

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