24
votes

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

2
Can you provide more context? And/or can you copy and paste the tracking code you're using so I can see if there are any errors? - Philip Walton
I am using classic code and nothing has changed, so why GA suddenly show the message for three my projects. Thank you <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-XXXXXXX']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> - tom52
Is this the only code? According to your error message, you're trying to send an event before tracking the pageview. Are you sure there's not some other code on the page doing this? - Philip Walton
I've got this error message as well. It was working fine and I had changed nothing. Did you found what was the problem ? - Ruzanna
I've also encountered this message a couple days ago and haven't changed anything. - Matt K

2 Answers

4
votes

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:

  1. Behavior > Events
  2. Acquisition > Social > Plugins
  3. 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.

0
votes

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