@autobusal/providers 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/Setup/analytics.ts +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to `@autobusal/providers` are documented here. This project
|
|
|
4
4
|
adheres to [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
5
5
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [1.6.2] - 2026-07-30
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **`Setup/analytics.ts` now initializes GA4 with `send_page_view: false`.**
|
|
12
|
+
Pairs with `@autobusal/common` 1.8.0, which sends every pageview
|
|
13
|
+
explicitly (including the first) from `Meta` instead - previously the
|
|
14
|
+
automatic initial page_view and any future manual tracking would have
|
|
15
|
+
double-counted the first page of every session.
|
|
16
|
+
|
|
7
17
|
## [1.6.1] - 2026-07-30
|
|
8
18
|
|
|
9
19
|
### Fixed
|
package/Setup/analytics.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import ReactGA from 'react-ga4';
|
|
2
2
|
|
|
3
|
+
// `send_page_view: false` disables gtag.js's automatic page_view on this
|
|
4
|
+
// initial `config` call - client-side route changes in this SPA never
|
|
5
|
+
// trigger another `config`, so relying on the automatic one meant only
|
|
6
|
+
// the very first page of a session was ever tracked. Every pageview
|
|
7
|
+
// (including the first) is instead sent explicitly from
|
|
8
|
+
// @autobusal/common's Meta component, which re-fires on every route change
|
|
9
|
+
// since it's rendered by (almost) every page - see the comment there.
|
|
3
10
|
const analytics = (id: string | null): void => {
|
|
4
11
|
if (id === null) {
|
|
5
12
|
return;
|
|
6
13
|
}
|
|
7
14
|
|
|
8
|
-
ReactGA.initialize(id);
|
|
15
|
+
ReactGA.initialize(id, { gaOptions: { send_page_view: false } });
|
|
9
16
|
};
|
|
10
17
|
|
|
11
|
-
export default analytics;
|
|
18
|
+
export default analytics;
|