For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Analytics

This guide applies only when selling pre-orders through Purple Dot's own checkout. Pre-orders sold through the Shopify checkout benefit from the same tracking as your regular sales.

If you have enabled Google Analytics tracking on the Integration settings page in the Merchant Portal, the Purple Dot checkout automatically sends certain events to Google Analytics 4 via the Measurement Protocol.

What you need before you start

  • A Google Analytics 4 property for the store

  • The GA4 Google tag active on the storefront (for example via the Google & YouTube Shopify app, Google Tag Manager, or a theme tag), with the _ga cookie being set for visitors

  • Admin (Editor) access to the merchant’s Google Analytics property

Prerequisites

Before connecting Purple Dot, the GA4 tag must already be running on the Shopify storefront. Purple Dot will not send any server-side events for a session where it cannot find the browser _ga cookie that GA4 sets (this is used as the Measurement Protocol client_id).

Use the same Measurement ID everywhere. The Measurement ID you enter in Purple Dot must match the GA4 web data stream already collecting storefront browser events. If these don’t match, connection tests may pass but production checkout events won’t stitch to the correct sessions.

Step 1 - Install the Google & YouTube app on Shopify

  1. In Shopify Admin, go to Settings → Apps and sales channels (or open the Google & YouTube app on the Shopify App Store).

  2. Install Google & YouTube (by Google LLC).

  3. Open the app and sign in with the Google account that has access to the merchant’s Google Analytics property.

  4. Connect the Shopify store to the correct Google account / Analytics property.

  5. When prompted, set up or connect a Google Analytics 4 property and web data stream. Use the same Measurement ID you plan to use for Measurement Protocol and Purple Dot.

  6. Complete the app setup and confirm the Google tag is connected and active on the storefront.

Use the same Measurement ID everywhere. The Measurement ID you enter in Purple Dot must match the GA4 web data stream connected in the Google & YouTube app and shown in Google Analytics. If these don’t match, connection tests may pass but production events will go to the wrong property—or checkout events won’t attribute correctly.

Verify the tag is working on the storefront

  1. In Shopify Admin, go to Settings → Customer events

  2. Verify the app is “Connected”

  3. On the Google & YouTube app, click “Test”

  1. Accept any cookie consent banner that covers analytics cookies.

  2. Confirm events are being processed

  3. In GA4, open Reports → Realtime and confirm storefront page views are arriving.

Step 2 - Find the Measurement ID and create an API Secret

Find the Measurement ID

  1. Go to Admin → Data streams.

  2. Open the Web data stream used on the storefront.

  3. Copy the Measurement ID (format G-XXXXXXXX).

Use this value in Purple Dot’s Measurement ID field.

Create a Measurement Protocol API Secret

  1. Stay on the same data stream.

  2. Open Measurement Protocol API secrets.

  3. Click Create, give it a nickname such as Purple Dot, and create the secret.

  4. Copy the Secret value immediately and store it securely.

This secret is what Purple Dot calls API Secret.

You must have Editor (or higher) permission on the GA4 property to create API secrets.

Step 3 - Add credentials in Purple Dot

  1. Log in to the Purple Dot Merchant Portal.

  2. Go to Settings → Integrations.

  3. Under Analytics, click Connect for Google Analytics.

  4. In the Google Analytics connection modal, enter:

    Field

    Value

    Measurement ID

    Measurement ID from Step 2

    API Secret

    API Secret from Step 2

  5. Click Save.

After the connection is saved, Purple Dot sends real server events automatically when a Google Analytics connection exists for the store.

Checkout / preorder action
GA4 event name

Add to cart

add_to_cart

Initiate checkout

begin_checkout

Add payment info

add_payment_info

Pre-order created

purchase

Events include ecommerce fields such as currency, value, and items. Purchase events also include a transaction_id (the Purple Dot pre-order / checkout id). When available, Purple Dot also forwards session_id (from the _ga_ session cookie) and Google click identifiers (gclid / gbraid / wbraid) so server events can attribute correctly.

Step 4 - Verify the connection

There are two ways to verify the integration. Use Option A for a quick credential check, Option B to test the full checkout flow end-to-end.

Option A - Test Connection in the modal (recommended for first setup)

  1. In the Google Analytics connection modal, fill in Measurement ID and API Secret.

  2. Click Test Connection (bottom-left of the modal).

  3. Wait for “Credentials verified!”

Purple Dot sends a dedicated validation event to Google’s Measurement Protocol debug endpoint:

  • Event name: purple_dot_test

  • Client ID: 555.555

This confirms the Measurement ID and API Secret are accepted by Google. The debug endpoint validates the payload; it is not the same as a storefront checkout event.

Option B - Test via live checkout (end-to-end)

This option verifies the full integration: storefront → Purple Dot checkout → GA4 Measurement Protocol → Realtime reporting.

  1. Open the storefront and accept cookie consent so the _ga cookie is set.

  2. In GA4, open Reports → Realtime (keep this tab open).

  3. Complete a test pre-order/checkout flow (add to cart, open checkout, enter payment details, complete the order).

  4. In Realtime, confirm the checkout events appear — for example add_to_cart, begin_checkout, add_payment_info, and purchase.

Tip: Server events are only sent when Purple Dot can read a GA4 client_id from the storefront _ga cookie. If Realtime stays empty after a test checkout, re-check cookie consent and that the Measurement ID in Purple Dot matches the storefront data stream.

Last updated