What is the simplest way to count # of visits by a user in an ASP.NET web app?
Our app services anonymous users, registered users and an intermediate user, called a "prospect". Prospects are users that request information but do not create an account.
We leave an ID cookie for every type of user, and that's the key into our database for visit information.
Prospects never "sign in" per se, but we still want to count those visits. We also want to count member visits, even when they don't sign in.
I am thinking of storing the ASP.NET Session cookie and then incrementing our counter every time the session cookie changes.
Anyone out there already solve this, or have any suggestions?
PS: We are ASP.NET 1.1
Refinement: We want this data in our app's database, so Google Analytics is not a reasonable solutions for this...and we are using Google Analytics.
Use Google Analytics. You can specify "goals" and "funnels" that lead to these goals quite easily.
Since you're using 1.1... in the Global.aspx... in the App_EndRequest (or whatever), insert a record into a DB with Name, IPAddress, timestamp, etc.
EDIT: Don't do the session thingy, sessions can be cleared, plus how will you report on them days, or weeks later... insert a record (including the Request.Url.Path if you'd like to have those kinds of stats).
Because it's on the EndRequest method, it's pretty safe even if there is some sort of glitch... also, performance won't matter as the user has gotten his page sent to him already.
We leave an ID cookie for every type of user, and that's the key into our database for visit information
Sounds to me like you already have a counter, you just need to figure out a way to make this data useful.
SELECT COUNT(1) FROM TblUsers WHERE UserType = 'Prospect' AND DateRange Between....
Related
I'm new when using google analytics for App and it make me quite confused, I have several question that I want to ask:
Is Google Analytics still track unique users? some of source that I read say no but and some say yes I'm quite confused about this
Let say if I want to search a Unique users can I use User Type dimension with users metric to get the right value for new users (Not with session but users)
for question number 2, let say it have New Users and Returning Users as user Type dimension and users have a metric and from google analytics itself give an explanation such as this:
Users who have initiated at least one session during the date range. Learn more about how Analytics calculates the number of users.
Can someone help me to understand this? I'm already using it for 2 weeks and still confused with this
By default, Google Analytics track unique users by setting an unique id (clientId) in device memory (a cookie in web tracking). This method isn't accurate because cleaning a cookie or device cache would reset clientId, causing the tool to identify a new user in the next session. To avoid it you can collect User Id, a built-in dimension specific to user tracking.
I’m wondering if anyone can help me. I’m currently working on a project which involves trying to understand customers who have abandoned one of the stages within a checkout but then returned to the site at a later stage and converted. I would then break this down to the number of days before they returned. I’ve tried creating segments however the data doesn’t seem to be making sense. Has anyone any idea how I’d go about this? Is this even possible in GA or is this something I can only accomplish in BigQuery if at all?
Your help will be very much appreciated.
Google Analytics(GA hereafter) is counting a visitor as a new or returning user by persisting cookie values in client side(in the browser). So once a user is visited, It stores an id which is specific to that user (actually this user means the browser which had been used to visit the website). So when a user visits the site for the first time, GA will store a specific id in a GA related cookie in the client side. If the user visits the website again later in another session, then GA check if there is a client.id for that user stored in the client side. If it found then that user is count as a returning user or New user otherwise.
In Google Analytics, goto Audience -> User Explorer. In there you can see an aggregated view of each user(client.id) interacted with your website and clicking on one client.id will show each user's activities with the website(differentiated by sessions) and will show all the sessions related to that user with the information like time, URL and some other dimension values.
Also if you want to separate out New users or Returning users from each other, you can create a new segment with a condition checking for the User Type dimension against the values "New Visitor" or "Returning Visitor".
To measure returning customers after an abandonment and converted, you can create a segment as follows,
It seems that it's not possible in GA.
There are no metric like "Days between abandoned funnel and conversion" (only "Days before transaction" - between acquisition day and transaction day). So you need a date for abandoned funnel and a date for conversion separately: i.e. you need two reports.
I know solution, but Excel or smth like this is needed if you want to calculate days before conversion.
At first you need to have Client ID as a custom dimension.
Then create custom report contains dimensions Client ID and Date and metric [Your Goal] Abandoned Funnel (Goal with Funnel needs to be set).
And the second report - Client ID, Date and [Your Goal] Complection.
And to merge these tables using Client ID parameter.
Background of my specific environment: I am trying to set up GA to track the user journeys around an iOS native app written in React Native. The app is in-house only and all users consent to being tracked in this way.
As I understand it, the measurement protocol allows either Client ID (cid) or User ID (uid). In the docs, both are optional, but at least one is required. Makes sense so far. Client ID is an anonymous UUIDv4 that tracks a browser or device, but not necessarily a user. User ID on the other hand is some uniquely-identifying value for a user, but may cross devices/browsers.
Initially I wrote my application using cid (as I hadn't yet read the docs on uid). Every time a user logged in the user's uuid would be stored and sent as the cid parameter. I also used session control sc. This worked - I saw sessions coming in, the User Explorer showed me the individual user uuids and sessions, etc. But upon rereading the docs, this seemed like an incorrect use of cid. It seems like cid is meant to be consistent and not something that changes as you log in and out.
As people on my app can log in and out (and possibly will - staff members may well share devices), using a long-lasting cid that is specific to the device won't allow me to track the habits of individual users and changing it per login-session, as mentioned above, feels wrong.
So I switched out cid for uid. The docs say both are optional and one is only required if the other is not used, so I figured I could just use uid and use the user's uuid in that field and it's otherwise act the same.
However, when doing it this way no hits seems to be registered at all - in "real time data" as well as the User Explorer.
Am I doing something wrong or is this by design? (If by design, are the docs wrong to say cid and uid are both optional or am I reading it incorrectly?)
Either way, best-practices-wise, do I:
Just go back to using an ephemeral cid that only changes when people log in and out. Individual sessions in the app don't change the cid but I do use sc to explicitly start and end sessions by navigation inference (click 'home' = sc=end, navigate from 'home', sc=start).
Use uid as I am trying to (i.e. switching out the current cid for uid), but also include a random cid that never changes (regardless of session lifetime, logging in and out, etc.).
Something else?
I have seen this question and its answer but it does not really answer my actual question regarding how cid and uid should actually be used, and if my issue is me or the way that GA works.
Oki so client-id is randomly generated value and must be sent with all hits.
In a non-User-ID-enabled view, Client-ID is used to calculate unique users. In a User-ID-enabled view, User-ID is used to calculate unique users
In reference to your app, you can send the unique Device id value in place of random value for client-id. This will resolve all your problems and ensure that the client id is sent with all the hits, otherwise it wont get registered in GA
Google Analytics now has UserID tracking to better track individual users across devices. Is it possible to add a tracking variable (like utm_campaign) specifying user_ID so that GA will associate those links with the user?
I'm looking for a solution that'll work even when the user isn't logged in (mainly for email link tracking).
No. Of course you can append the user id yourself and set it in your tracking code. But that would not uniquely identify a user (links get bookmarked or passed around e.g. when the email is forwareded to somebody) and someone else might end up with that id. The idea of the user id is that the CMS or CRM takes responsibilty for uniquely identifying users so we don't have to rely on the somewhat fragile client side mechanisms.
If you use it for email tracking it should IMO be enough if the user id is set in the first call of the tracking code if you have session unification enabled, so you'd just need to tag the link in the mail and read the id from there, without needing to persists the user id via the links. While I haven't tested this extensively the documentation seems clear on the point:
Session unification is a User ID setting that allows hits collected
before the User ID is assigned to be associated with the ID, so long
as those hits happen within the same session in which a specific ID
value is assigned for the first time.
Please note that the user id feature does not expose data for individual users via the interface, insofar the idea that it "better track[s] individual users" is not quite right (it will recognize users across devices but will still aggregate the data). If you want individual user you need to store the user id (or some other unique id) as custom dimension.
I was wondering, is it possible to set an User ID and track all the history of this user, even if it's not set since the first GA event ?
For example, if a visitor comes on my website, visits few pages... And then sets his email somewhere. I can send an event with a custom unique user ID, but is it possible to link this custom unique User ID with all the previous events ?
UserId must be sent with all hits from that user. The moment you start sending it Analytics can fill in previous hits within the same session, that requires that you use Session Unification ON. All future hits on the same session must have userId, session unification will fill in previous hits but not future hits without userId.
It's not possible to do a unification with past sessions either.
I highly recommend that you read through the Session Unification Help Center Article where this behavior is well documented.