Mobile app version of vmapp.org
Login or Join
Sherry384

: Tracking first visit date in Google Analytics I want track a site's visitor retention using Google Analytics, to see if unregistered users are returning to it, within a time frame of 2+ months

@Sherry384

Posted in: #GoogleAnalytics #Visitors

I want track a site's visitor retention using Google Analytics, to see if unregistered users are returning to it, within a time frame of 2+ months from now.

This blog post seems to be on the right track, but I want to track unregistered users, so I don't have a "join date" or similar variable at my disposal.

This other blog post suggests using all 5 GA custom variables, using the first variable slot on the first week, variable 2 on week 2, etc. This method will allow me to track 5 weeks of visitors.

I want to track more than 5 weeks of visitors, so I was thinking on using two custom variables in GA: visitor's first visit date, and visitor's last visit date.

How I can save the first visit date? Because if I save another value in the same slot the old value will be overwritten, and I don't know how reliable is to save that variable conditionally (reading the __utmv cookie to check whether the "first visit date" is set, if it isn't set I save the current date)

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Sherry384

2 Comments

Sorted by latest first Latest Oldest Best

 

@Ravi8258870

It sounds like you're on the right track. To track basic retention in Google Analytics you just need to store the initial visit date in a custom variable. Next, using the custom variable and possibly some regex, create an advanced segment which filters for a specific date range of these new visitors. For example, all users who visited for the first time 2 months ago. Finally, use the advanced segment in a report which is constrained to a date range such as last month. That should tell you how many of your visitors from 2 months ago came back the next month, which is your monthly retention.

You also asked how reliable it is to set the first visit date in the cookie only if it's not already set. That's what I've always done and the logic works fine. If you're wondering whether you can trust that a visitor didn't delete their cookies after their first visit, well, you can't. I cover retention analysis in Google Analytics and the issue of cookie tracking reliability on my blog if you need more details.

10% popularity Vote Up Vote Down


 

@Rambettina238

You could write a simple PHP/MySQL script to log all unique IP addresses visiting your site, mark the timestamp, and then not add duplicate entries unless the difference between "timestamp" and "now" is greater than some period of time. Or, you create two entries per IP address: the first time they visit, they are the same. Next time they visit, it checks if that IP is already in the database, and if so, updates the second entry. That way, you'll always have a list (could be graphed) of an IP address's first visit date, and last time they visited. Some would obviously be the same time, and easily displayed as "never returned."

I'll update this answer with some sample code when I get home from work.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme