Reputation: 2319
I was wondering if there was a way to identify if the users on my web page is a returning user or not using the information Google Analytics already generates.
I want to display different things for returning visitors and I know Analytics already tracks this. Is there a way to tap into this information on webpage side?
Thanks!
Upvotes: 1
Views: 2012
Reputation: 1823
Yes, you can read and parse Analytics cookies. Those cookies contain that data.
Presuming that you have a function readCookie()
that returns cookie value by cookie name:
var visits = readCookie('__utma').split('.').pop() //returns number of visits
if(visits>1) {
// Returning visitor
}
Upvotes: 8
Reputation: 7270
New vs Returning visits are already reported on in:
Report: Audience -> Behavior -> New vs Returning (good for high level metrics)
Advanced Segments: New Visitors or Returning Visitors (good for filtering and comparing across all metrics/reports)
Upvotes: -3