Connect Google Analytics 4
Add the Google Analytics 4 tag with e-commerce events to your store and send server purchases: Measurement ID, API secret and how the purchase is counted once.
What it is#
Google Analytics 4 (GA4) shows you who visits your store, where they come from and what they buy. Jukto adds the GA4 tag to every page of your live store and reports the standard e-commerce events. With an API secret, a purchase that is confirmed later (cash on delivery, manual confirmation) is reported from the server.
What you need#
- A Google Analytics 4 property with a web data stream. If there is none, create one for your store address.
- The Measurement ID (it starts with G-).
- Optional: a Measurement Protocol API secret for server purchases.
Where to find your keys#
- 1
Open your data stream
Open Google Analytics, go to Admin, then Data streams, and select your web stream.
- 2
Copy the Measurement ID
Copy the Measurement ID (it starts with G-). You paste it into the Measurement ID field in Jukto.
- 3
Optional: create the API secret
In the same data stream open Measurement Protocol API secrets and press Create. Copy the secret into Measurement Protocol API secret.
What Jukto does#
- The Measurement ID is a setting. The GA4 tag (gtag.js) is placed on every page of your live store, never in the editor preview.
- The API secret is stored encrypted and used only on the server, to send a purchase.
- Test connection checks the ID format. With a secret it asks Google's validation service to check a sample purchase, and tells you what Google found wrong, if anything.
- If a Google Tag Manager container is on, Jukto does not load GA4 itself: add a GA4 tag inside the container, and keep this integration for the server purchase only.
| Event | When it is sent |
|---|---|
| view_item_list, view_item | when a list or a product is shown |
| add_to_cart, remove_from_cart | when the cart changes |
| begin_checkout, add_shipping_info, add_payment_info | along the checkout |
| purchase | from the browser when the order is confirmed at once (automatic confirmation), or from the server when you confirm it later; never both |
Test and turn on#
- 1
Open the provider page
Go to Tools, open Integrations, choose Marketing & ads, then Google Analytics 4 and press Set up (it says Manage once you have started).
- 2
Fill in the fields and save
Paste each value into the field with the same name, then press Save. A secret value is stored encrypted, and afterwards only its last four characters are shown.
- 3
Test the connection
Press Test connection. Jukto asks Google Analytics 4 whether the saved values work and shows whether it worked and, if not, what Google Analytics 4 answered. The test uses the saved values, so save first.
- 4
Turn on
Press Turn on. Until then your website does not use it. Turn off stops it again and your saved values stay.
- 5
Look at the Realtime report
Open your live store in another tab, browse, and look at the Realtime report in Google Analytics. Your visit should appear within a short time.
Common errors#
| What you see | What to do |
|---|---|
| the Measurement ID looks like G-XXXXXXXXXX | You pasted something else. Copy the ID that starts with G- from the data stream. |
| validation: followed by what Google found wrong | The Measurement ID and the API secret do not belong to the same data stream. Create the secret in the stream of this Measurement ID. |
| validation call failed | Google's validation service did not answer. Wait a minute and test again. |
| measurement id format OK; without an API secret the browser tag is used alone | This is fine: it only says no server purchase will be sent. Add the secret if you want one. |
| Purchases are missing in Google Analytics | If you confirm orders by hand, the purchase is sent from the server when you confirm, and it needs the API secret. Without it, those purchases are not sent. |

Comments (0)
Anyone can comment. Please do not post phone numbers, passwords or customer details.