Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(web-analytics): Add information on differences between tools, and direct traffic #9385

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion contents/docs/web-analytics/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,49 @@ 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, 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 is my pageview/user count different on PostHog than my other analytics tool?

### 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](/docs/advanced/proxy) which makes it harder for ad blockers to block our traffic.

### 2. Different methods of counting unique users

*Affects: visitor count*

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.

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

*Affects: session 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

*Affects: visitor count, session count, pageview count*

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 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.

robbie-c marked this conversation as resolved.
Show resolved Hide resolved
## Why am I getting a lot of direct traffic?

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:** 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.
Loading