Search code examples
google-analyticsuniversal-analytics

Google Analytics - Overriding Default Values


I am trying to confirm a 'pageview' is being processed properly. ( using google real time dashboard ).

The issue is simple, If I use this call:

// page uri is: www.example.com/signup
ga( 'send', 'pageview' );

I see a matching entry at google's dashboard.

Attempting to override the title / page parameters ( according to the docs ) like so:

ga( 'send', 'pageview', {
    'page': '/admin/logout',
    'title': "test"
} );

Simply produces nothing over at google's side.

Any idea what is going on?

EDIT

It appears that google analytics service is filtering pages that contain the word "admin".

Removing that from the 'page' helped in my case.


Solution

  • I don't know what's going on because your syntax is definitely correct.

    FWIW, while the real time dashboard is a great way to see your hits come in, it should not be considered proof or evidence that something is or isn't working. Everything you send to Google Analytics goes through processing after it comes in, and (for a variety of reasons) a hit may be dropped from reports after showing up successfully in the real time view.

    There's also always the possibility that there's a bug in the real time dashboard, and a particular hit may not show up even though it will ultimately make it into your Google Analytics reports.

    A much more reliable way to see if your code is working is to take a look at the data that is actually being sent from your page. You can do this via the network inspector (in Chrome) or by using the debug version of analytics.js, which logs status and error message to the console.