@autobusal/providers 1.6.0 → 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 +20 -0
- package/Setup/Preload.tsx +12 -2
- package/Setup/analytics.ts +9 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ 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
|
+
|
|
17
|
+
## [1.6.1] - 2026-07-30
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- **`Organization`/`WebSite` JSON-LD `url` was wrong** (introduced in 1.6.0,
|
|
22
|
+
same day) - used `data.url` (`SettingsData.url`, from `Label::url()`),
|
|
23
|
+
which is deliberately the obtapi asset-storage path for this label's
|
|
24
|
+
uploaded files (`https://obtapi.../storage/labels/{label}`), not the
|
|
25
|
+
site's own public domain. Now uses `window.location.origin`.
|
|
26
|
+
|
|
7
27
|
## [1.6.0] - 2026-07-30
|
|
8
28
|
|
|
9
29
|
### Added
|
package/Setup/Preload.tsx
CHANGED
|
@@ -31,11 +31,21 @@ const Preload = ({ data, children }: Props): JSX.Element => {
|
|
|
31
31
|
// sitelinks searchbox), and this app's search is inherently two-field
|
|
32
32
|
// (from/to) - forcing it into that shape would just be invalid structured
|
|
33
33
|
// data, not a working sitelinks box.
|
|
34
|
+
//
|
|
35
|
+
// NOTE: `data.url` (SettingsData.url, from Label::url()) is deliberately
|
|
36
|
+
// the obtapi ASSET STORAGE path for this label's uploaded files
|
|
37
|
+
// (https://obtapi.../storage/labels/{label}) - that's correct for the
|
|
38
|
+
// favicon/font hrefs below, which really do live there, but wrong for
|
|
39
|
+
// anything meaning "this site's own homepage" (Organization/WebSite.url).
|
|
40
|
+
// window.location.origin is the actual public domain, whatever it is for
|
|
41
|
+
// this brand/environment.
|
|
42
|
+
const siteUrl = window.location.origin;
|
|
43
|
+
|
|
34
44
|
const organizationLd = {
|
|
35
45
|
'@context': 'https://schema.org',
|
|
36
46
|
'@type': 'Organization',
|
|
37
47
|
name: data.preferences.company,
|
|
38
|
-
url:
|
|
48
|
+
url: siteUrl,
|
|
39
49
|
logo: `${ data.url }/favicons/apple-touch-icon.png`,
|
|
40
50
|
sameAs: Object.values(data.preferences.social).filter(Boolean)
|
|
41
51
|
};
|
|
@@ -44,7 +54,7 @@ const Preload = ({ data, children }: Props): JSX.Element => {
|
|
|
44
54
|
'@context': 'https://schema.org',
|
|
45
55
|
'@type': 'WebSite',
|
|
46
56
|
name: data.preferences.company,
|
|
47
|
-
url:
|
|
57
|
+
url: siteUrl
|
|
48
58
|
};
|
|
49
59
|
|
|
50
60
|
return (
|
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;
|