Repository navigation
docs: add a guide for Storefront analytics with Google Analytics 4 - #2608
Björn Meyer (BrocksiNet) wants to merge 12 commits into
Conversation
Developer Docs healthcheckStatus: Completed with |
|
Manual test plan for the GA4 stack: https://gist.github.com/BrocksiNet/8aec805bd315dfd7ab4bb0ab86726c4f It covers the whole stack (shopware/shopware#21606 to shopware/shopware#21612). For each area there are test cases with steps and the events and payloads to expect, plus console snippets that show the events and the deployed version. The plan also lists the findings from the test runs and which PR fixes each of them. Every case that can be tested was run in a browser, on a local trunk instance and on the preview environment of shopware/shopware#21613 (preview head shopware/shopware@e1769598880). All findings are fixed. Cases that cannot be tested on the preview instance are listed with the reason. |
… a converted guest in GA4
…t and category request behaviour
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3615a62601
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".
…e product box block
Co-authored-by: sushmangupta <112690947+sushmangupta@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The guide contains unresolved inaccuracies about analytics metadata, search and cart events, and graduated-price reporting.
5 open issues
Distinguish analytics-only attributes from shared product metadata · New Document both type-ahead and results-page search events · New Scope cart value and coupon parameters to applicable events · New Document limits of add-to-cart tier price resolution · New Avoid promising matching detail-page prices for graduated tiers · New
What changed in this PR
Adds a Storefront analytics guide for Shopware 6.7.17.0 and later, documenting GA4 behavior and extension integration.
Changes:
- Documents event payloads, gtag and Google Tag Manager delivery, list identifiers, and custom events.
- Adds the guide to the advanced Storefront navigation.
- Grants the announcement detector workflow write access to pull requests.
| File | Description |
|---|---|
guides/plugins/plugins/storefront/advanced/storefront-analytics.md |
Adds the GA4 reference and extension examples |
guides/plugins/plugins/storefront/advanced/index.md |
Links the new analytics guide |
.github/workflows/announcement-detector.yml |
Changes pull-request permissions from read to write |
Review effort: Balanced
|
|
||
| Analytics are configured per sales channel in the Administration, in the analytics settings of the sales channel. The Storefront only loads the analytics script when a tracking ID is set and analytics are active. With the default cookie consent, the script only starts after the shopper accepted the Google Analytics or Google Ads cookie. | ||
|
|
||
| A sales channel without active analytics renders none of the analytics attributes described in this guide, loads no analytics script, and answers the analytics routes with a 404. |
| | `login` | A login succeeded. Reported on the page after the login, so a wrong password reports nothing | | ||
| | `sign_up` | A customer account was created, also by a guest with "Create account" on the checkout finish page. Reported on the page after the registration. A guest checkout and a failed registration report nothing | | ||
| | `search` | The shopper searches | | ||
|
|
| The cart, checkout and `purchase` events report these event parameters: | ||
|
|
||
| * `value` is the position price: all line items including promotion discounts, without shipping. | ||
| * `coupon` holds the codes of the applied promotions, separated by a comma. |
| * `shipping` and `tax` of `purchase` are reported separately from `value`. | ||
| * Discounts and other line items that are not products are not reported as items. | ||
|
|
||
| `add_to_cart` reports the unit price of the graduated price that applies to the quantity the cart holds after the add, and the value of the added quantity. |
| | `price` | No | `price` | | ||
| | `variant` | No | `item_variant` | | ||
|
|
||
| Report the price the shopper pays for one piece, as in the example: `calculatedPrices.first` when a price rule or graduated prices apply, otherwise `calculatedPrice`. The product box and the product detail page do the same. |

Summary
Related links
Checklist
PageRefreferences where relevant..gitbook.yamlif pages were moved, renamed, or deleted..wordlist.txt(and sorted it) if spellcheck flags new legitimate terms.Notes
The whole Shopware stack is merged into trunk and ships with Shopware 6.7.17.0, the version this guide names as the first one with this behavior.