Fix kit B: measurement
Reporting should carry on through the move, and the logo customizer, the store's most distinctive feature, should be countable. This kit does both without an app release.
On 13 October the store carried no Google tag; the pixels present were Mailchimp, Judge.me, Shopify.
Three measurement IDs on the old site are not on the store: CallRail, G-L0NH6ZFLR1, G-PSBSPNTX9L.
The customizer's twelve script files, 6,751 lines in all, held zero analytics calls.
The first step is yours and needs no code: connect the Google & YouTube channel in Shopify to the existing GA4 property, so years of history stay in one place and the standard shop events start flowing.
The eight events
eight| Event | Fires when | Parameters |
|---|---|---|
| customizer_login_prompt_click | A guest clicks the button that leads to login | product_handle |
| customizer_open | The logo window opens | product_handle |
| logo_upload | An upload finishes or fails | ok, file_type, size_bucket |
| placement_select | A logo is placed in a zone | view, decoration_method |
| preview_generate | A preview is requested | ok, duration_bucket |
| customized_add_to_cart | A customized item reaches the cart | product_handle, placements, decoration_method |
| pdf_ready | The instruction PDF is ready | none |
| customizer_error | A customizer request fails | endpoint, status |
No event carries a customer ID, an email, a logo file name, a logo URL or a PDF URL. In GA4, customized_add_to_cart becomes a key event.
A small theme script loads after the customizer. It waits a few seconds for the customizer to appear, then wraps its public functions: each wrapper calls the original, returns its result untouched, and publishes one event. If a function is missing, the script does nothing and never throws.
A custom pixel subscribes to the eight events and forwards them to GA4. It runs only with analytics consent.
In the long run these events belong inside the extension itself. The theme script is the version that can ship without waiting for an app release.
Tested by unit tests alone, against a stand-in for the customizer with the same function names: each event fires once per action with only its listed parameters, results and errors pass through unchanged, the script stays under two kilobytes compressed, and on a page without the customizer it does nothing.
Proof on a Shopify development store with GA4 DebugView is the next step. Nothing is installed on your store.
The button a guest sees builds its login link by adding a second question mark to an address that already has one, so the return path is swallowed into another parameter and the shopper lands somewhere else after logging in. That cause is an inference from the markup.
| State | Link |
|---|---|
| Seen | /account/login?region_country=US?return_to=/products/… |
| Fixed | /account/login?region_country=US&return_to=%2Fproducts%2F… |
The kit fixes it twice: once in the template, and once as a small guard script that repairs the link in the page. Four cases are tested. No login was attempted on your store, so what happens after login is not tested.
- A decision on the GA4 property and on call tracking.
- Theme access for one script file and one template change, made on a duplicate theme first.
- Admin access to add the custom pixel and set its consent permission.
- Half an hour in GA4 to mark the key event and register three custom dimensions.