question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Session id is written to ClientId? (all users count as new users?)

See original GitHub issue

Im a bit confused i have a WPF application where i use GoogleAnalyticsTracker.Core and GoogleAnalyticsTracker.Simple, version: 4.1.40.0.

But when i use TrackAsync it seems all users count as new users, so i looked at the source code and TrackAsync calls this.SetRequired which in turn calls parameters.ClientId = this.AnalyticsSession.GenerateSessionId() and ClientId equals to cid and the description for cid is:

Required for all hit types.

This anonymously identifies a particular user, device, or browser instance. For the web, this is generally stored as a first-party cookie with a two-year expiration. For mobile apps, this is randomly generated for each particular instance of an application install. The value of this field should be a random UUID (version 4) as described in http://www.ietf.org/rfc/rfc4122.txt

Why on earth does it write a session id to cid, this way all users will count as new users?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
maartenbacommented, Jul 28, 2016

A fresh build is on its way to NuGet 😃 (4.1.41 should be there in ~30 minutes)

0reactions
AnderssonPetercommented, Jul 28, 2016

To make it less confusing i would rename GenerateSessionId to GenerateClientId or GetClientId but that would break a lot of existing applications so i guess thats out of the question.

So why not just change

parameters.ClientId = this.AnalyticsSession.GenerateSessionId();

to

if (string.IsNullOrWhiteSpace(parameters.ClientId))
{
    parameters.ClientId = this.AnalyticsSession.GenerateSessionId();
}

That way the programmer can set ClientId on their own without the framework overwriting it? Any thoughts?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Analytics Unique vs New vs Returning Users ...
Every time a new id is detected, GA counts a new user. When GA detects an existing client ID in a new session,...
Read more >
Does Client ID work in concert with Session Unification?
Premise: we are considering cid and uid as custom dimensions with user scope. In your example you are able to connect all by...
Read more >
BigQuery Tips for Universal Analytics: Users and Sessions ...
In this first post of our new blog series, Google Analytics + BigQuery Tips, we will look at how users and sessions are...
Read more >
What is Client ID in Google Analytics: detailed setup guide
The Client ID (cid) is a unique identifier for a browser–device pair that helps Google Analytics 4 link user actions on a site....
Read more >
Google Analytics Client ID vs User ID
In this blog post, I will explain the differences of Google Analytics Client ID vs User ID, and when they are used.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found