Configuration

Google Analytics 4 (GA4) Setup

Track customer behavior and checkout funnels accurately. Combine browser-side tag tracking with server-side Measurement Protocol payloads to eliminate data gaps.

Why Server-Side Tracking is Necessary

Standard browser-side Google Analytics scripts regularly drop 15% to 30% of user data due to ad-blockers, iOS tracking restrictions (ITP), and network interruptions.

TrakIt bridges this gap by combining browser-side tracking with the **GA4 Measurement Protocol**. While the client tag reports front-end interactions, TrakIt's server listens to secure Shopify back-end webhooks. The moment an order completes, TrakIt fires a server-side payload containing exact revenue, transaction IDs, items, and cookies directly to Google's servers, restoring missing conversion data.


Select Integration Method

Select your integration method inside the GA4 Configuration panel:

Manual

Manual Setup

Paste Measurement ID and API secrets from Google Analytics manually. Best if you wish to bypass Google OAuth authorization. GTM tags must be downloaded and imported manually.

View Manual Setup steps
Recommended
Auto

Automatic Setup

Connect Google OAuth. TrakIt automatically reads your properties, creates API secrets, saves stream IDs, and updates GTM containers via API — no file uploads required.

View Automatic Setup steps

1. Manual Setup Instructions

Step A: Retrieve Your Measurement ID

  1. Log into your Google Analytics 4 dashboard.
  2. Navigate to the bottom-left corner and click Admin.
  3. Under the property settings, click Data Streams → select your active Web stream.
  4. Copy the Measurement ID (formatted as G-XXXXXXXXXX) and paste it into TrakIt.

Step B: Generate Measurement Protocol API Secret

  1. Inside the same Web Stream settings panel, scroll down and click Measurement Protocol API secrets.
  2. Click Create.
  3. Give the secret a recognizable name (e.g., TrakIt Server Sync) and save.
  4. Copy the generated Secret value string and paste it into the *Measurement Protocol API Secret* field in TrakIt.
  5. Click Save inside the Configuration panel.

Activating Settings and Event Selection

In Manual Setup, the *Save* buttons under **Event Selection** and **Settings** are disabled at first. Once you save the primary Measurement ID and API Secret under *Configuration*, these lower cards automatically unlock for editing.

Step C: Google Tag Manager (GTM) Container Sync

To load Google Analytics web tracking tags onto your storefront, the tag layout configuration must be synced with your Google Tag Manager (GTM) workspace:

Automatic GTM Import (Recommended)

If your Google Account is connected to TrakIt, all Google Analytics 4 events and tag configurations will be imported automatically into your GTM container via GTM API. There is no need to download or upload container files manually.

If your Google account is not connected, you must download the container JSON file from TrakIt's right-hand sidebar and import it manually:

How to import manually into GTM:

  1. Open your Google Tag Manager workspace.
  2. Go to AdminImport Container.
  3. Upload the downloaded container file.
  4. Choose Merge.
  5. Click Confirm to integrate the tag configurations.

* Note: Since we automatically import the tags into the container when the Google account is connected, there is no need to manually import it.


2. Automatic Setup Instructions (OAuth)

  1. Select the **Automatic Setup** tab in the GA4 Configuration card.
  2. Click Connect with Google and grant the requested OAuth permissions to manage Analytics properties and GTM containers.
  3. Once redirected back to TrakIt, select your:
    • Google Analytics Account
    • GA4 Property
    • Web Data Stream
  4. Click Create & Setup GA4.
  5. TrakIt automatically queries credentials, configures API secrets, and pushes tag changes directly to your GTM workspace via API — no file downloads required.

GA4 Event Selection Matrix

TrakIt allows you to customize exactly which storefront actions are pushed to GA4, split by client-side browser tags (Web) and backend webhook triggers (Server):

Event NameTrigger ActionServerWeb
Page ViewedA customer views any page on your store.-
Collection ViewedA collection or category page is opened.-
Product ViewedA product details page is opened.-
Search SubmittedA customer performs a storefront search query.-
Added to CartA product is added to the shopping cart.-
Removed from CartA product is removed from the shopping cart.-
Cart ViewedA customer views the cart page.-
Checkout StartedCustomer enters checkout.-
Contact Info SubmittedCustomer enters email or phone.-
Address SubmittedCustomer enters shipping address parameters.-
Shipping Info SubmittedCustomer selects shipping options.-
Payment Info SubmittedCustomer enters billing card details.-
Checkout CompletedCustomer successfully places an order.
RefundAn order is partially or fully refunded.-
LoginA user logs into their customer account.-
RegisterA user creates a storefront profile account.-
Email SubscribeA user opts into marketing emails.-

Granular Integration Settings

TrakIt provides a dedicated **Settings** panel containing six configurations to adjust values and identifiers:

Order Identifier

Define how transaction conversions are recorded in Google Analytics reports. Select from:

  • Transaction ID (Default, recommended: uses Shopify's internal alphanumeric transaction ID).
  • Order Number (e.g. #1024).
  • Order Name (Shopify order code name parameters).

Product Identifier

Determine how products are identified in your shopping reports. Choose from:

  • Product ID (Shopify standard product numeric string ID).
  • Variant ID (The identifier code for specific sizes, colors, or choices).
  • SKU (Stock Keeping Unit alphanumeric codes to align with your warehouse management catalog).

Exclude Sales Channels

Allows you to block and exclude orders created by specific sales channels from triggering GA4 conversion events. For example, check and select:

  • Recharge (Prevent subscription rebilling orders from skewing marketing attribution counts).
  • Shopify Draft Orders (Exclude manual checkouts made via storefront admin).
  • Point of Sale (POS) (Exclude physical retail orders from online web traffic channels).
  • Zapier / API Channels (Exclude programmatic orders).

Tax and Shipping Toggles

Fine-tune valuation metrics for conversion reports with checkout toggles:

  • Exclude Tax from Conversion Value:Deducts sales taxes from the overall value before sending the event parameters to GA4.
  • Exclude Shipping from Conversion Value:Removes shipping fees and shipping tax components from GA4 purchase calculations.
  • Include Discounts in Conversion Value:Ensures discount codes, promotional credits, and coupons are subtracted from order pricing values.

Unlinking & Cleanup

If you need to change setup modes, correct account mappings, or remove Google Analytics 4 integration entirely:

  1. Click Disconnect in the Disconnect panel at the bottom of the left column.
  2. TrakIt automatically coordinates GTM workspace updates:
    • For Automatic Setup: TrakIt uses the GTM API to automatically delete all tags, triggers, and variables injected during setup to clean your workspace.
    • For Manual Setup: Clears local TrakIt configurations. (You must manually delete the imported tags from your GTM dashboard).