Welcome to Magic Google Analytics 4

Configure your analytics tracking in just a few steps.

Getting Started

Follow these steps to set up Google Analytics 4 for your Shopline store:

  1. Create a Google Analytics 4 property:
    • Go to Google Analytics
    • Click on "Admin" in the bottom left corner
    • In the Account column, click "Create Account" if you don't have one
    • Follow the steps to set up a new property for your Shopline store
    • Once created, note down your Measurement ID (it starts with "G-")
  2. Configure Magic Google Analytics 4:
    • Enter your Measurement ID in the field below
    • Select the e-commerce events you want to track
    • Click "Save Changes" to apply your configuration
  3. Enable the Theme App Extension:
    • Go to your Shopline admin panel
    • Navigate to Online Store > Themes
    • Find your current theme and click "Customize"
    • In the theme editor, click on "App embeds" in the sidebar
    • Find "Magic Google Analytics 4" in the list and click "Enable"
    • Alternatively, click the "Enable Theme App Extension" button below
@csrf

Configuration


These events are automatically tracked by Google Analytics 4's enhanced measurement:

Page View
Scroll
Outbound Click
Site Search
Video Engagement
File Download
Form Interaction

@php $enabledEvents = $setting->events ?? []; @endphp
Add To Cart

Tracks the items that are added to a cart for purchase.

Parameters Tracked:
CurrencyProduct IDProduct Title Product TypeProduct PriceTotal Value CampaignEngagement TimeMediumPage Referrer
Checkout

Tracks completed transactions.

Parameters Tracked:
ProductsCouponCurrency Order IDTaxTotal Value ShippingCampaignMediumPage Referrer
View Item

Tracks the most popular items viewed.

Parameters Tracked:
CurrencyProduct IDProduct Title Product TypeVendorProduct Variant PriceCampaignEngagement TimeMediumPage Referrer
View Cart

Tracks the cart and its contents when it is viewed.

Parameters Tracked:
CurrencyProductsProduct Variants PriceTotal ValueCampaign Engagement TimeMediumPage Referrer
Important Notes: