mckenna.niall
17 May 2022 22:44
1
Hi does anyone know if the pack for Google Analytics has been updated to work with GA4 and the new tracking ID? @Pablo would you have to know?
orballo
18 May 2022 11:18
2
It looks like the last version should be compatible with GA4.
mckenna.niall
18 May 2022 22:58
3
The docs still have the UA Tracking ID placeholder in them. Do we still use this but add the new GA4 Tracking ID?
where are you seeing the above patch changes or where can I get that package?
packages: [
{
name: "@frontity/google-analytics",
state: {
googleAnalytics: {
trackingId: "UA-12345678-9",
},
},
},
],
};
orballo
19 May 2022 08:40
4
I am not familiar with this package but I’d say yes.
It looks like the package signature didn’t change:
state: Analytics["state"] & {
/**
* State properties for the Google analytics package.
*/
googleAnalytics: {
/**
* Tracking ID associated to a Google Analytics account.
*/
trackingId?: string;
/**
* List of tracking IDs associated to a Google Analytics account.
*/
trackingIds?: string[];
/**
* JSON configuration object to include inside the `<amp-analytics>` tags,
* useful to add variables and triggers. Note that this props is only used
* when the `@frontity/amp` package is installed.
*
This file has been truncated. show original
The changes were made in this PR:
frontity:dev ← frontity:frontity-google-analytics-4
opened 07:33AM - 01 Mar 21 UTC
This change will require a major version bump for `@frontity/google-analytics` s… ince the ways of handling pageviews and event data has changed.
<!--
Thanks for your pull request 😊. Note that not following the template might
result in your issue being closed.
-->
<!--
Please make sure you're familiar with and follow the instructions in the
contributing guidelines found in the
https://docs.frontity.org/contributing/code-contributions.
-->
<!--
If you're new to contributing to open source projects, you might find this free
video course helpful: http://kcd.im/pull-request
-->
<!--
Please fill out the information below to expedite the review and (hopefully)
merge of your pull request!
-->
**What**:
Update @frontity/google-analytics to work with the new GA4.
**Why**:
GA4 introduces a new way of sending events and pageview data.
**Tasks**:
- [x] Code
- [x] TypeScript
- [x] Unit tests
- [x] TypeScript tests
- [x] Update other packages
- [x] Add a changeset (with link to its [Feature Discussion](/c/33) if it exists)
<!-- Changesets are necessary if your changes should release any packages.
Run `npx changeset` to create a changeset.
More info at https://docs.frontity.org/contributing/code-contribution-guide#what-is-a-changeset -->
**Unrelated Tasks**
- [ ] TSDocs
- [ ] End to end tests
- [ ] Update starter themes
- [ ] Update community discussions
**Additional Comments**