kalnyc67 / analytics-issues

Automatically exported from code.google.com/p/analytics-issues
0 stars 0 forks source link

UserID code example is incorrect #497

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On this page:

https://developers.google.com/analytics/devguides/collection/analyticsjs/user-id

The sample code will only execute "ga('create', ..." if the user is logged in. 
I would expect it to run:

ga('create', 'UA-XXXX-Y', { 'userId': '%s' });

if a user is logged in and:

ga('create', 'UA-XXXX-Y');

if a userId is not available.

Original issue reported on code.google.com by goo...@vanbragt.com on 18 Sep 2014 at 8:05