kangguru / rack-google-analytics

Simple Rack middleware for implementing google analytics tracking in your Ruby-Rack based project. Supports synchronous and asynchronous insertion and configurable load options
MIT License
257 stars 53 forks source link

add option to enable user attribution feature #43

Closed masarakki closed 10 years ago

masarakki commented 10 years ago

see it: https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad

masarakki commented 10 years ago

it's same as #41 so close

grimmwerks commented 10 years ago

Is this the same thing as the User-ID feature? Or is the following done just by doing add_item?

Google Analytics cannot generate, assign, or manage the unique IDs that are assigned as User-IDs. To use this feature, you must generate your own IDs and be able to consistently associate them with a set of data. In a typical scenario, these IDs can be generated through your authentication system, passed to an account at sign-in, and then sent to Google Analytics.

Add the following line to your tracking code to send User-ID data to Google Analytics: ga(‘set’, ‘&uid’, {{USER_ID}}); // Set the user ID using signed-in user_id.

Where the value of USER_ID is a string and represents the stable and unique ID retrieved from your system.