Documentation
Analytics & Pixels: GA4 + Meta Pixel Full Guide
Analytics & Pixels (liteshop-analytics-pixels) adds Google Analytics 4 and/or a Meta (Facebook) Pixel to your LiteShoper storefront, with ecommerce events for product views, add to cart, checkout, and purchase.
On this page: Overview · Prerequisites · Install · Create GA4 · Create Meta Pixel · Paste IDs · Ecommerce events · Verify · Ads tips · Checklist · Troubleshooting
1. Overview
- Loads GA4 (
gtag.js) and/or Meta Pixel (fbevents.js) on the storefront only - Automatic PageView / base page tracking
- Ecommerce:
view_item,add_to_cart,begin_checkout,purchase(GA4 + Meta equivalents) - Toggle each event on/off in Settings
- Purchase is deduped per order number per browser session (thank-you page reloads won’t double-count)
Plugin page: liteshoper.com/plugins/liteshop-analytics-pixels (if published) · In-store: Integrations → Analytics & Pixels
2. Prerequisites
- Plugin activated under Admin → Plugins
- Storefront on HTTPS (recommended for accurate browser tracking)
- Optional: a GA4 property and/or Meta Business Pixel (you can use either or both)
- Optional: cookie-consent banner if required in your region (this plugin does not include one)
3. Install the plugin
- Install / activate
liteshop-analytics-pixelsfrom the marketplace or Plugins - Open Integrations → Analytics & Pixels → Setup Guide (or Settings)
4. Create Google Analytics 4 (Measurement ID)
- Open https://analytics.google.com/ and sign in
- Create an account / property if you don’t have one
- Admin → Data streams → Web
- Create or open your web stream (website URL = your storefront domain)
- Copy the Measurement ID — format
G-XXXXXXXXXX
Help: Set up a GA4 web stream · Verify with Google Tag Assistant or GA4 DebugView
5. Create a Meta (Facebook) Pixel
- Open Meta Events Manager
- Connect a data source → Web → Meta Pixel
- Name the pixel and enter your storefront URL
- Copy the numeric Pixel ID (digits only)
Help: Create and install a Meta Pixel · Verify with Meta Pixel Helper (Chrome) or Events Manager → Test Events
6. Paste IDs in LiteShoper
- Go to Analytics & Pixels → Settings
- Check Enable Analytics & Pixels on the storefront
- Paste GA4 Measurement ID (
G-…) and/or Meta Pixel ID - Leave ecommerce event toggles on (recommended) or turn off what you don’t need
- Click Save settings
Status should show Ready. Scripts load only when enabled and at least one valid ID is saved.
7. Ecommerce events LiteShoper sends
Currency for most events comes from store settings. Purchase uses the order currency when set.
| When | GA4 event | Meta event |
|---|---|---|
| Every storefront page (base tag) | gtag config / page_view | PageView |
| Product page | view_item |
ViewContent |
| Add to cart succeeds | add_to_cart |
AddToCart |
| Checkout page | begin_checkout |
InitiateCheckout |
| Order thank-you page | purchase |
Purchase |
Item IDs: prefer variation SKU; otherwise ls-{variation_id}.
Purchase payload includes transaction ID (order number), value, tax, shipping, coupon (if any), and line items.
8. Verify tracking
- Open the storefront in a private/incognito window
- GA4: Tag Assistant or Admin → DebugView — confirm page_view and ecommerce hits
- Meta: Pixel Helper or Events Manager → Test Events — confirm PageView and conversions
- Walk a test path: product → add to cart → checkout → complete order → thank-you page
9. Ads & attribution tips
- Use the same domain in GA4 / Meta as your live storefront
- For Meta Ads, set Purchase as the conversion optimization event
- For Google Ads, link GA4 and import conversions (or use GA4 purchase)
- Purchase is session-deduped by order number if thank-you reloads
- Add a consent banner separately if GDPR/CCPA requires it before loading tags
10. Admin pages
| Page | Path | Purpose |
|---|---|---|
| Setup Guide | analytics-pixels/setup-guide |
In-admin A–Z steps |
| Settings | analytics-pixels/settings |
Enable, IDs, event toggles |
11. Go-live checklist
- Plugin activated
- GA4 Measurement ID and/or Meta Pixel ID created
- IDs pasted; plugin enabled; status Ready
- Desired ecommerce events checked
- Tag Assistant / Pixel Helper confirm base tags
- Test purchase fires once on thank-you
- Ads accounts linked / conversion goals set (if advertising)
12. Troubleshooting
| Issue | Fix |
|---|---|
| Status “Needs IDs” | Enable plugin and enter a valid G-… ID and/or numeric Pixel ID |
| Status “Disabled” | Check Enable on Settings and save |
| Invalid GA4 ID ignored | Must match G- + alphanumeric (saved uppercase) |
| No scripts on admin | Expected — tags load on storefront only |
| Add to cart not firing | Ensure cart success path fires liteshop:added-to-cart (theme/product JS); event toggle on |
| Purchase missing | Land on thank-you with order number; toggle on; check order exists |
| Double purchase | Plugin dedupes by order number in session; clear cache/extensions that strip sessionStorage if needed |
| Blocked by consent / adblock | Test without blockers; load tags after consent if legally required |
Official references:
Google Analytics · Tag Assistant · Meta Events Manager · Create a Meta Pixel · In-store: Analytics & Pixels → Setup Guide