From 0168658e80ac52b4b75cd1c145d890780c8c3ea1 Mon Sep 17 00:00:00 2001 From: Robbie Coomber Date: Thu, 19 Sep 2024 12:32:13 +0100 Subject: [PATCH 1/4] Add information on differences between tools, and direct traffic --- contents/docs/web-analytics/faq.mdx | 39 ++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/contents/docs/web-analytics/faq.mdx b/contents/docs/web-analytics/faq.mdx index 864d4db2e65e..8afd6f2a7e7d 100644 --- a/contents/docs/web-analytics/faq.mdx +++ b/contents/docs/web-analytics/faq.mdx @@ -34,4 +34,41 @@ All good web analytics dashboards need to include a world map. Ours includes it ## Do stats include bots and crawlers? -No, we automatically block bots and crawlers. You can see exactly which ones [we block here](https://github.com/PostHog/posthog-js/blob/master/src/utils/blocked-uas.ts). \ No newline at end of file +No, we automatically block bots and crawlers. You can see exactly which ones [we block here](https://github.com/PostHog/posthog-js/blob/master/src/utils/blocked-uas.ts). + +## Why are my pageview/users count different on posthog than GA/vercel/plausible/etc +### Ad Blockers +*Affects: visitor count, session count, pageview count* + +Around 1 in 3 internet users use an ad blocker, more in some demographics, with 25-34 being the highest. + +Google Analytics is blocked by almost every ad blocker, whereas other analytics tools are not always blocked. Additionally, you can use a reverse proxy which makes it harder for ad blockers to block our traffic. + +### Different methods of counting unique users +*Affects: visitor count* + +In posthog, you can identify users with e.g. an email address or a user ID, so a user who logged in twice on two different devices would be correctly counted as one visitor. Analytics tools that don’t allow for identifying users would incorrectly count these as two visitors. + +Cookieless trackers, e.g. Plausible and Vercel, track users by combining a few properties into a hash. This includes the user agent, the IP address, and a daily salt. This means that if a user visited your site 7 days in a row, they would be counted as 7 different visitors, as the salt will be different each day. In Posthog, if the user is identified, or if you are using cookies, they will be correctly counted as 1 visitor. These cookieless trackers also incorrectly count the same user on different devices as different visitors, as the user agent would differ. + +### Different methods of tracking sessions +*Affects: session count* + +A session is a grouping of user activity, which starts on the first event (e.g. page view) and ends after 30 minutes of inactivity. By default, we store the user’s current session ID in a cookie. Other tools might have a different timeout period, or a different way of storing the session state, which can affect the count. + +### Bot detection +*Affects: visitor count, session count, pageview count* + +Some traffic to your site might be bots, e.g. search engines, archivers, content scrapers, etc. You may want some of these to be able to access your site, but you don’t want them to appear in your analytics data. Different tools use different methods, which may result in different visitor or page view counts. + +Our client-side bot detection code in posthog-js is available here https://github.com/PostHog/posthog-js/blob/main/src/utils/blocked-uas.ts (Pull Requests welcome!), and we automatically prevent detected bots from sending events. + +## Why am I getting a lot of direct traffic? +Direct traffic can refer to when a user enters the address to your website directly, however, it also includes any traffic where the referrer is unknown or impossible to calculate. We use the `document.referrer` property, which might be hidden for a few reasons: +* Some browsers and privacy extensions strip hide the referrer, particularly in private browsing / incognito mode. +* Links opened from an app (for example, a messaging or email app) won’t have a referrer set. You can use UTM tags to help attribute links shared this way. Note that many apps, like the iOS Mail app, will strip ad-specific parameters like `gclid`/`fbclid`/etc. +* Browsers won’t include the referrer for links from HTTPS to HTTP. +* Link tracking or redirection services may result in the original referrer being lost. +* Websites can specify that the referrer should not be sent, by including the `referrerpolicy` meta tag in the page or `rel="noreferrer"` on the link. + +Note that if you have auto-tagged traffic set up in Google Ads, parameters set this way do not appear as URL parameters, and therefore aren’t available for us to use for attribution. You can set up tracking templates in Google Ads to add query parameters automatically. From edaf3745934fc99ebd4d08e8879ec0b82f986754 Mon Sep 17 00:00:00 2001 From: Robbie Date: Thu, 19 Sep 2024 16:53:42 +0100 Subject: [PATCH 2/4] Update contents/docs/web-analytics/faq.mdx Co-authored-by: Ian Vanagas <34755028+ivanagas@users.noreply.github.com> --- contents/docs/web-analytics/faq.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contents/docs/web-analytics/faq.mdx b/contents/docs/web-analytics/faq.mdx index 8afd6f2a7e7d..fa62b576ea0c 100644 --- a/contents/docs/web-analytics/faq.mdx +++ b/contents/docs/web-analytics/faq.mdx @@ -36,7 +36,8 @@ All good web analytics dashboards need to include a world map. Ours includes it No, we automatically block bots and crawlers. You can see exactly which ones [we block here](https://github.com/PostHog/posthog-js/blob/master/src/utils/blocked-uas.ts). -## Why are my pageview/users count different on posthog than GA/vercel/plausible/etc +## Why is my pageview/user count different on PostHog than my other analytics tool? + ### Ad Blockers *Affects: visitor count, session count, pageview count* From 1eaddc9741aab40354e572a627daf4e97aaa0e22 Mon Sep 17 00:00:00 2001 From: Robbie Date: Thu, 19 Sep 2024 16:56:53 +0100 Subject: [PATCH 3/4] Apply suggestions from code review Co-authored-by: Ian Vanagas <34755028+ivanagas@users.noreply.github.com> --- contents/docs/web-analytics/faq.mdx | 33 +++++++++++++++++------------ 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/contents/docs/web-analytics/faq.mdx b/contents/docs/web-analytics/faq.mdx index fa62b576ea0c..805495204fa1 100644 --- a/contents/docs/web-analytics/faq.mdx +++ b/contents/docs/web-analytics/faq.mdx @@ -38,38 +38,45 @@ No, we automatically block bots and crawlers. You can see exactly which ones [we ## Why is my pageview/user count different on PostHog than my other analytics tool? -### Ad Blockers +### 1. Ad Blockers + *Affects: visitor count, session count, pageview count* Around 1 in 3 internet users use an ad blocker, more in some demographics, with 25-34 being the highest. -Google Analytics is blocked by almost every ad blocker, whereas other analytics tools are not always blocked. Additionally, you can use a reverse proxy which makes it harder for ad blockers to block our traffic. +Google Analytics is blocked by almost every ad blocker, whereas other analytics tools are not always blocked. Additionally, you can use a [reverse proxy](/docs/advanced/proxy) which makes it harder for ad blockers to block our traffic. + +### 2. Different methods of counting unique users -### Different methods of counting unique users *Affects: visitor count* In posthog, you can identify users with e.g. an email address or a user ID, so a user who logged in twice on two different devices would be correctly counted as one visitor. Analytics tools that don’t allow for identifying users would incorrectly count these as two visitors. -Cookieless trackers, e.g. Plausible and Vercel, track users by combining a few properties into a hash. This includes the user agent, the IP address, and a daily salt. This means that if a user visited your site 7 days in a row, they would be counted as 7 different visitors, as the salt will be different each day. In Posthog, if the user is identified, or if you are using cookies, they will be correctly counted as 1 visitor. These cookieless trackers also incorrectly count the same user on different devices as different visitors, as the user agent would differ. +Cookieless trackers, like Plausible and Vercel, track users by combining a few properties into a hash. This includes the user agent, IP address, and a daily salt. Because the salt changes every day, a user that visits your site 7 days in a row counts as 7 different users in these tools. In PostHog, if the user is identified, or if you are using cookies, they are correctly counted as a single user. + +These cookieless trackers also incorrectly count the same user on different devices as different visitors, as the user agent would differ. + +### 3. Different methods of tracking sessions -### Different methods of tracking sessions *Affects: session count* -A session is a grouping of user activity, which starts on the first event (e.g. page view) and ends after 30 minutes of inactivity. By default, we store the user’s current session ID in a cookie. Other tools might have a different timeout period, or a different way of storing the session state, which can affect the count. +A [session](/docs/data/sessions) is a grouping of user activity, which starts on the first event (e.g. pageview) and ends after 30 minutes of inactivity. By default, we store the user’s current session ID in a cookie. Other tools might have a different timeout period or a different way of storing the session state which can affect the count. + +### 4. Bot detection -### Bot detection *Affects: visitor count, session count, pageview count* -Some traffic to your site might be bots, e.g. search engines, archivers, content scrapers, etc. You may want some of these to be able to access your site, but you don’t want them to appear in your analytics data. Different tools use different methods, which may result in different visitor or page view counts. +Some traffic to your site might be bots like search engines crawlers, archivers, or content scrapers. You may want some of these to be able to access your site, but you don’t want them to appear in your analytics data. Different tools use different methods, which may result in different visitor or page view counts. -Our client-side bot detection code in posthog-js is available here https://github.com/PostHog/posthog-js/blob/main/src/utils/blocked-uas.ts (Pull Requests welcome!), and we automatically prevent detected bots from sending events. +Our client-side bot detection code is available on [GitHub](https://github.com/PostHog/posthog-js/blob/main/src/utils/blocked-uas.ts) (pull requests welcome!) and we automatically prevent detected bots from sending events. ## Why am I getting a lot of direct traffic? -Direct traffic can refer to when a user enters the address to your website directly, however, it also includes any traffic where the referrer is unknown or impossible to calculate. We use the `document.referrer` property, which might be hidden for a few reasons: -* Some browsers and privacy extensions strip hide the referrer, particularly in private browsing / incognito mode. -* Links opened from an app (for example, a messaging or email app) won’t have a referrer set. You can use UTM tags to help attribute links shared this way. Note that many apps, like the iOS Mail app, will strip ad-specific parameters like `gclid`/`fbclid`/etc. + +Direct traffic usually refers to when a user enters the address to your website directly, but it also includes any traffic where the referrer is unknown or impossible to calculate. We use the `document.referrer` property, which might be hidden for a few reasons: +* Some browsers and privacy extensions strip or hide the referrer, particularly in private browsing or incognito mode. +* Links opened from an app (for example, a messaging or email app) won’t have a referrer set. You can use UTM tags to help attribute links shared this way. Note that many apps, like the iOS Mail app, will strip ad-specific parameters like `gclid`, `fbclid`, etc. * Browsers won’t include the referrer for links from HTTPS to HTTP. * Link tracking or redirection services may result in the original referrer being lost. * Websites can specify that the referrer should not be sent, by including the `referrerpolicy` meta tag in the page or `rel="noreferrer"` on the link. -Note that if you have auto-tagged traffic set up in Google Ads, parameters set this way do not appear as URL parameters, and therefore aren’t available for us to use for attribution. You can set up tracking templates in Google Ads to add query parameters automatically. +> **Note:** If you have auto-tagged traffic set up in Google Ads, parameters set this way do not appear as URL parameters, and therefore aren’t available for us to use for attribution. You can set up tracking templates in Google Ads to add query parameters automatically. From 9dab82857a709ba389dd14e5757d3ca14098761c Mon Sep 17 00:00:00 2001 From: Robbie Date: Thu, 19 Sep 2024 16:57:32 +0100 Subject: [PATCH 4/4] Update contents/docs/web-analytics/faq.mdx Co-authored-by: Ian Vanagas <34755028+ivanagas@users.noreply.github.com> --- contents/docs/web-analytics/faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contents/docs/web-analytics/faq.mdx b/contents/docs/web-analytics/faq.mdx index 805495204fa1..ac37d3ca70a4 100644 --- a/contents/docs/web-analytics/faq.mdx +++ b/contents/docs/web-analytics/faq.mdx @@ -50,7 +50,7 @@ Google Analytics is blocked by almost every ad blocker, whereas other analytics *Affects: visitor count* -In posthog, you can identify users with e.g. an email address or a user ID, so a user who logged in twice on two different devices would be correctly counted as one visitor. Analytics tools that don’t allow for identifying users would incorrectly count these as two visitors. +In PostHog, you can [identify](/docs/product-analytics/identify) anonymous users across with the same distinct ID across visitors and devices they are correctly counted as one user. Analytics tools that don’t allow for identifying users would incorrectly count these as multiple users. Cookieless trackers, like Plausible and Vercel, track users by combining a few properties into a hash. This includes the user agent, IP address, and a daily salt. Because the salt changes every day, a user that visits your site 7 days in a row counts as 7 different users in these tools. In PostHog, if the user is identified, or if you are using cookies, they are correctly counted as a single user.