↑↓ selectEnter openEsc close

    1. Elbuz

    How to connect Google Analytics 4 and the Meta pixel to your store

    4 min readUpdated

    An Elbuz CMS store sends product views, cart, checkout and purchases to Google Analytics 4 and the Meta pixel by itself. No code to paste — only IDs in the Elbuz store settings.

    When you need this:

    • You need to know which ads sell — purchases with amounts appear in GA4 and Meta.
    • Customers view a product and leave — Meta shows them ads for those products.
    • Ad blockers “eat” purchases — Conversions API sends them from the store server.
    • A service asks you to add code to the site — site verification, Tag Manager, a chat.

    Where to start: “Store settings” → “Integrations” → the “Tracking and ads” card.

    What the store's tracking can do

    How to connect Google Analytics 4 and the Meta pixel

    1. Open “Store settings” → “Integrations” section → the “Tracking and ads” card.
    2. In the “Google” block, in “How to connect Google”, choose “Google Analytics 4 directly” and paste the G-… ID.
    3. In the “Meta (Facebook, Instagram)” block, paste the “Pixel ID”.
    4. Turn on the “Enabled” switch at the top of the screen and click “Save”. Tracking appears on the site right away.
    Tracking and ads window with the Google and Meta blocks filled in and the store status card on the right
    1How to connect Google
    2GA4 measurement ID
    3Pixel ID
    4Conversions API access token
    5Status in the store
    1. Choose GA4 directly or through Tag Manager.
    2. The G-… ID from Google Analytics.
    3. Digits only, taken from Meta Events Manager.
    4. Optional: the purchase is also sent from the store server.
    5. Shows what is connected and whether the changes reached the store.

    You can connect only Google or only Meta. How “Save” works is covered in “Store settings”.

    GA4 directly or Tag Manager

    How to connect GoogleWhat happensFor whom
    Google Analytics 4 directlyThe store adds GA4 and sends events itselfIf you're not sure what to choose
    Google Tag ManagerThe store adds the container and puts events into it with standard GA4 names; a marketer sets up the tagsIf tags are already managed in Tag Manager
    Do not connectThere's no Google on the siteMeta only

    Choose one way. The same GA4 connected both directly and through Tag Manager doubles the data.

    Meta pixel and Conversions API

    The “Conversions API access token” is optional, but with it the purchase is also sent from the store server. An ad blocker can't lose it, and Meta merges the two copies of one purchase by itself. The token is a secret field and never appears on site pages.

    The “Test event code” is needed only while testing. Both fields appear once the pixel ID is set.

    Where to get the IDs

    FieldWhere to get itFormat
    GA4 measurement IDGoogle Analytics → Admin → Data collection and modification → Data streams → Web → your siteG-ABC123XYZ9
    GTM container IDTag Manager, at the top of your container pageGTM-AB12CD3
    Pixel IDMeta Events Manager → Datasets → your pixeldigits only, 10–20
    Conversions API access tokenEvents Manager → Datasets → pixel → Settings → Conversions API → Generate access token. The link is visible to users with developer rights in the business accounta long string of letters and digits
    Test event codeEvents Manager → Datasets → pixel → Test eventsTEST12345

    Type Google IDs in Latin letters: G-… and GTM-…. The screen won't save an ID in the wrong format and shows what it should look like.

    Which events are sent

    What the customer didGoogle Analytics 4Meta
    Opened any pagepage view (in the GA4 directly mode)PageView
    Opened a category, brand, specials or search resultsview_item_list—
    Clicked a product in a listselect_item—
    Opened a productview_itemViewContent
    SearchedsearchSearch
    Added to cart / removedadd_to_cart / remove_from_cartAddToCart / —
    Opened the cartview_cart—
    Started checkoutbegin_checkoutInitiateCheckout
    Chose delivery / paymentadd_shipping_info / add_payment_info— / AddPaymentInfo
    Placed an orderpurchasePurchase
    Added to a wishlistadd_to_wishlistAddToWishlist
    Sent the contact formgenerate_leadLead
    Tapped a phone, email or messengercontactContact

    Events include the product name, price, quantity, brand, category and variant, for example “Color: black”. A purchase is sent once per order: reloading the “Thank you” page won't double it. Amounts are taken from the order itself.

    Until the customer agrees in the cookie banner, tracking sends nothing:

    • Google Analytics starts after consent to “Analytics”, Tag Manager — after consent to “Analytics” or “Marketing”;
    • the Meta pixel and the server-side purchase — after consent to “Marketing”;
    • Google receives Consent Mode v2 signals.

    If the banner is turned off in the design but tracking is connected, the store still asks for consent with a simple bar at the bottom of the page. Tracking starts only after consent.

    Product data for dynamic ads

    The “Product data in events” block decides whether catalog ads find your product.

    • “Product identifier in events” — “Store product ID”, “Model (product code)” or “SKU”. Choose the field that is the product ID in your Google Merchant feed or Meta catalog. The default is the ID; an empty product field is also replaced with the ID.
    • “Prices with tax” — when on, prices in events include VAT, as the customer sees them. Delivery isn't included in the purchase amount.

    How to add a service's code to the site

    The “Codes on the site” block is for codes not covered by the fields above. For example: site verification for Paysera, Google Search Console or Meta, a marketer's Tag Manager, a chat widget, a price comparison site's conversion code.

    1. Under the list, click the template you need: “Site verification”, “Google Tag Manager”, “Conversion code”, “Chat widget” — or “Add”.
    2. Paste the code from the service in full, as is, and change “Where to insert”, “Pages” and “Cookie consent” if needed.
    3. Click “Save” — the code appears on the pages right away.
    Codes on the site block with one site verification entry and the template buttons below the list
    1Codes are on
    2Warning about full rights
    3Site verification row
    4Template buttons
    1. Turns off all codes at once; the entries stay saved.
    2. The code runs with full rights: paste only codes from services you trust.
    3. Site verification code: output at once, no consent needed.
    4. Ready-made templates with the right place and consent.
    FieldWhat it does
    Where to insert“As high as possible in <head>” — site verification and Tag Manager; “At the end of <head>” — most trackers; “Right after <body>” — the second part of Tag Manager; “At the end of the page, before </body>” — chat widgets
    PagesNothing selected — all pages. “Thank you for your order” — for conversion codes
    Cookie consent“Always needed” — the code is there right away; “Analytics” or “Marketing” — only after the customer's consent. A code made only of <meta> tags is output right away

    Up to 20 codes, each up to 16,000 characters. Codes work even when the module's “Enabled” switch is off. They don't run in the design editor.

    A code runs on the site with full rights. Add only codes from services you trust. If the site breaks, turn off “Codes are on”: all codes disappear from the pages, and the records stay.

    Don't add a tracker connected in the “Google” or “Meta” block as code too — the data doubles, and a warning appears on the right of the screen. Use code for a different Tag Manager container when Google is connected as “Google Analytics 4 directly”.

    How to check that everything works

    1. Turn on “Test mode” in the “Check” block and save.
    2. Open the site in a private browser window and click “Accept all” in the banner.
    3. Google: Google Analytics → Admin → Data display → DebugView. For Tag Manager — “Preview” in Tag Manager itself.
    4. Meta: Events Manager → Datasets → pixel → Test events, or the Meta Pixel Helper extension. Copy the code into “Test event code” and save — the server-side purchase also appears in the list.
    5. Place a test order and check purchase / Purchase with the correct amount.
    6. Cancel the test order in Elbuz, clear “Test event code” and turn off “Test mode”.

    In test mode, every event is printed in the browser console (F12 → Console) with the [elbuz_tracking] tag. While the test mode or test code is on, the right side of the screen reminds you to turn it off.

    Scenarios

    Home appliances: bring back people who were choosing a washing machine

    Connect the pixel and in “Product identifier in events” choose the same field as in your Meta catalog feed. In Meta Ads, create a dynamic ad for people who “viewed but didn't buy”. A customer who looked at three washing machines sees exactly those on Instagram.

    Electronics: where customers drop off

    Connect GA4. In “Explore” → “Funnel exploration”, add the steps view_item → add_to_cart → begin_checkout → add_payment_info → purchase. You see at which step most people leave — for example, when choosing a payment method.

    Verify the site for Paysera

    In “Codes on the site”, click “Site verification”, paste the <meta …> tag from Paysera and save. In Paysera, run the check. Google Search Console and Meta verify the site the same way.

    Tag Manager from a marketer

    The marketer manages the tags. In the “Google” block, choose “Google Tag Manager” and paste GTM-…: cart and purchase events arrive in the container ready to use.

    What to do when data doesn't arrive

    What you seeWhyWhat to do
    There are no events in GA4 or Meta The module is off, or you didn't accept cookies in the browser you're testing in Check “Enabled” and accept cookies in a private window. You can change your choice with the “Cookie settings” link at the bottom of the page
    “The GA4 ID looks like G-XXXXXXXXXX.” Another number was pasted, for example the numeric stream ID Copy the ID that starts with G-
    Every purchase appears twice in GA4, and the right side says “…data will be counted twice” The same tracker is connected both by a field and by code Turn off the code row with this tracker in “Codes on the site”
    Dynamic ads don't find products “Product identifier in events” doesn't match the ID in the feed In the “Product data in events” block, choose the same field as in the feed
    “The Conversions API token looks wrong…” The token wasn't copied completely Copy the token from Events Manager again, in full

    FAQ

    How do I count purchases in Google Ads?

    The module sends purchases to GA4. In Google Ads, import them as conversions from GA4: Goals → Import → Google Analytics 4.

    Can I connect the TikTok pixel?

    Not with a field. Add its code in “Codes on the site” with “Marketing” consent.

    Can I connect two Meta pixels?

    No, there is one pixel ID. Don't add a second pixel as code: the screen warns that the data will be counted twice.

    Are refunds sent to GA4?

    No, the module sends purchases, but not refunds.

    Why are there no page views in GA4 with Tag Manager?

    In Tag Manager mode, page views are counted by the GA4 tag in your container. The module puts only store events into the container.

    Where to find it and who has access

    Menu
    Directories → Operations → Store settings → “Integrations” → “Tracking and ads”
    Access rights
    the “Store settings” window in group permissions
    Prepare
    a Google Analytics 4 property with a web stream, a pixel in Meta Events Manager

    Related topics

    Was this article helpful?

    Missing a feature? Tell us.

    We will add it for free if other users need it too.

    If only you need it, we will agree on it separately.

    Article contents

    Suggest an improvement

    Try Elbuz free