MobiariDocs

Ad tracking

From the first click to the sale, sent from the server to Meta, Google, TikTok and GA4.

Mobiari follows the customer from the ad click to the paid order and credits each sale to the right campaign. Conversions are sent from the server, not only from the browser, so ad blockers, Safari and switching devices get in the way far less.

1. How it works

  1. The click. The storefront keeps where the visitor came from: the UTM tags and the ad click ids (gclid, fbclid, ttclid and others).
  2. The order. When the order is created, Mobiari ties it to the visitor, the customer and their conversations, and records the first source and the last source of the previous 30 days.
  3. The payment. When the payment is approved (card, Pix or manual), the sale is queued and sent to each platform you set up. If a platform is down, the send is retried on its own for up to two days.
  4. After the sale. Refunds and cancellations are sent back to Google Ads and GA4, so ad returns are not inflated.

Every sale goes to the ad platforms except those of visitors who turned ad cookies off in Preferências de cookies, in the store footer. Counter and WhatsApp sales are sent normally.

2. Set up the platforms

In Grow → Marketing → Pixels and accounts, each platform has a card that says whether it is Connected or Not connected. Click Connect (or Change, if it is already connected), fill in only the ones the store uses and click Save. Keys are stored and not shown again: leave a field blank to keep the current one.

  • Meta (Facebook + Instagram): Meta Pixel ID and CAPI access token.
  • Google Ads: Customer ID, Conversion action ID and the API credentials (Developer token and the OAuth credentials). When the account is linked to Mobiari's Google Ads manager account, your own credentials are folded under Use your own Google Ads API credentials. To also receive the contacts from the store's WhatsApp button, create a lead conversion action in Google Ads (source Import, from clicks) and paste its number in Lead conversion action ID (WhatsApp). Empty, no lead goes to Google Ads. Once Google Ads is connected, the card shows the Enhanced conversions box: tick it to also send the buyer's e-mail and phone, already protected. Test upload to Google makes a test send.
  • TikTok: Pixel code and Events API access token. The pixel code alone turns on the TikTok pixel in the browser; the token also turns on the server-side sends.
  • Google Analytics 4: Measurement ID (G-…) and Measurement Protocol API secret. The ID alone turns on Google Analytics in the browser; the secret also turns on the server-side sends.
  • Google Tag Manager: Container id (GTM-…). The store loads your Tag Manager container on every page.

Connect Google Ads with Google

Instead of filling in the OAuth credentials, the store can sign in with the Google account that manages its Google Ads:

  1. In Pixels and accounts, on the Google Ads card, click Continue with Google.
  2. Choose the Google account and allow access to Google Ads and Merchant Center.
  3. Back in Mobiari, in the same tab, check the Google e-mail and the store name shown and click Connect this account. If you did not start the connection, click Cancel: the access is deleted and revoked at Google.
  4. Pick the store's Google Ads account from the list and click Use this one. Accounts the store reaches through a manager account show that account's number.
  5. Click Change on the card and fill in the purchase Conversion action ID, as with the other kinds of access.

Only the person who clicked Continue with Google, signed in to Mobiari, in the same tab and on the same store, can complete the connection, within 10 minutes. If "The Google connection was not completed" shows, start again from the button.

To use another Google Ads account, click Change account. To remove the access, click Disconnect: Mobiari deletes the access and revokes it at Google. The store can also revoke it at myaccount.google.com/permissions.

The button only shows once Mobiari makes the Google connection available. Until then, use your own API credentials or Mobiari's access.

To test without affecting your ads, use Meta's or TikTok's Test event code. While it is set, events show only in the platforms' test screens, and the card shows a warning.

3. Events sent

Besides the purchase, the server sends Meta, TikTok and GA4 the steps on the way to the sale, always with the same id the browser pixel uses, so the platform counts each one once:

  • Product viewed and added to cart: the price comes from the catalog, never from the page.
  • Started checkout: with the cart's items.
  • Lead: when someone submits a store form with an e-mail or phone, or types their WhatsApp in the store's WhatsApp button.
  • Purchase, refund and value correction.

No e-mail or phone travels in plain text: platforms receive only the hash of each piece of data.

Pixels in the browser

Each pixel loads on the store only when its ID is filled in under Pixels and accounts, with no theme change: Meta Pixel, Google Ads, Google Analytics 4, Google Tag Manager and the TikTok pixel. All of them follow the visitor's choice in Preferências de cookies (cookie preferences): someone who turns ads off is no longer measured by them.

On the store's pages, the pixels get the shopping events: product viewed (view_item), added to cart (add_to_cart), started checkout (begin_checkout) and purchase (purchase). Products carry the same ID as in the Meta Pixel and the catalogs (the variant's ID), and the event carries the same id as the server-side send, so TikTok counts each once. In Tag Manager, the events go into the data layer in GA4's ecommerce format (ecommerce).

GA4 does not match a browser event with the server's. So when the Measurement Protocol API secret is filled in, the browser sends GA4 visits only, and the shopping events go through the server only.

A sale that came from a click-to-WhatsApp ad reaches Meta once, through the WhatsApp conversation (Meta's business-messaging dataset), and not through the pixel: the order confirmation page then does not fire the browser pixel's Purchase either, so Meta does not count the sale twice. If your store uses a custom theme that fires its own Purchase (fbq('track', 'Purchase', ...)) on the confirmation page, put it inside {% if order.meta_browser_purchase != false %} ... {% endif %}. The field is described in the theme reference.

Where an order's Purchase goes is decided at its first send and never changes: linking the order to another conversation, unlinking it or changing the conversation's origin afterwards changes Mobiari's reports, not where the Purchase went. If the conversation can no longer send it (it or its channel was deleted), the sale is not sent through the pixel instead; the reason shows in the order's delivery status.

4. Check it is arriving

In Grow → Marketing → Sent to ad platforms you see:

  • Sales not reported, at the top, when there are any (see below).
  • Server-side events: over 7 days or 30 days, how many events of each kind were sent, failed or skipped on each platform. For purchases, also how many were rejected (and tried again), timed out and not reported.
  • The list of orders with the send state for each platform. A send being tried again shows when the next attempt is and which one, for example "next try in 2 h · attempt 2 of 4". Skipped means the sale was not meant to be sent, for example the visitor turned ad cookies off.
  • Chat conversions: the events sent to Meta for conversations that started from a WhatsApp or Instagram ad (the lead, the qualified lead and the purchase), with Send failed ones again.

Retries

Mobiari does not give up on a sale at the first failure:

  • The platform did not answer (down, slow, rate limit): it tries again in seconds, then at longer and longer intervals, for about two days.
  • The platform rejected it (expired token, missing permission, pixel not found): it tries again 3 times, 15 minutes, 2 hours and 12 hours after the previous attempt. The cause is often fixed in the meantime, for example when someone reconnects the account.

The sale always goes to the same place with the same id, so the platform does not count it twice. No attempt is made more than 7 days after payment: Meta no longer accepts it.

Sales not reported

A sale is not reported when every attempt ended without the platform accepting it, or when it can no longer be sent (for example, the WhatsApp conversation of the ad was deleted). Sales that were not meant to be sent do not count: the visitor refused ad cookies, the platform is not set up, the order did not come from a Google click, it is a test order.

When there are sales not reported, the Sales not reported section shows, by platform and cause, how many there are and their value, and the cause in plain words. To fix it:

  1. Fix the cause. Expired token or missing permission: reconnect the account in Grow → Marketing → Pixels and accounts. Pixel or dataset not found: check the configured ID.
  2. Click Resend on the cause's row, or Resend all. Each sale starts its attempts over and leaves the list once the platform accepts it.

Meta no longer accepts sales older than 7 days. Fix the cause as soon as you get the alert.

Alerts for the team

Whoever has access to the store's marketing gets an alert (in the bell and by e-mail, unless turned off in your notification preferences) when:

  • sales are left not reported;
  • a platform rejects or does not answer 3 sends in a row;
  • paid sales came in over the last 24 hours and a configured platform accepted none of them.

The alert names the platform, how many sales, their value and the cause, and opens the Sent to ad platforms view already filtered. At most one alert a day per platform and cause; the next one counts what happened since.

In Grow → Marketing → Campaigns, the Google Ads campaigns box shows, for the period you picked (7, 30 or 90 days), Google's spend, clicks and conversions next to the orders and revenue Mobiari credits to each campaign, and the return on spend (ROAS). Campaigns that spent without a single sale are flagged Spending without sales. To create and manage campaigns, see Google campaigns.

Auto-tagged clicks are tied to their campaign through Google's click report; you do not need to build UTM tags. The note at the bottom counts orders from Google clicks not yet tied to a campaign.

6. Meta and TikTok ads

Meta and TikTok do not name the campaign in the click. For the order to be credited to the campaign, put tags in the ad's URL, for example:

utm_source=facebook&utm_medium=paid&utm_campaign={{campaign.id}}&utm_content={{ad.id}}

On TikTok, use utm_source=tiktok&utm_medium=paid&utm_campaign=__CAMPAIGN_ID__. Boosts and full Meta campaigns made in Mobiari already go out tagged.

7. The store's WhatsApp button

A visitor who taps the store's WhatsApp button first sees a small sheet with the Seu WhatsApp field, the Quero receber ofertas pelo WhatsApp box (unticked) and the Abrir WhatsApp button. The number is optional: Pular, Abrir WhatsApp with the field empty, or a second tap on the button all open the chat without a number. The number is remembered on the device, and a signed-in customer's is filled in already.

  1. The message that opens in WhatsApp carries a short code. By default it is invisible: the customer sees only Olá! Tenho interesse, and the code travels with it as characters that do not show on screen. In Como o código vai na mensagem, in the Botão do WhatsApp section, the Visível option ends the message with the code in sight, for example Olá! Tenho interesse #w7k2fq3m. When the first message arrives, Mobiari ties the conversation to the visit by the code or, without it (for example when the customer deleted the message and wrote another), by the number typed in the previous 7 days. The conversation gets the visit's source (source, medium, campaign and the ad click). The source of a click-to-WhatsApp ad still wins.
  2. With the number, the visitor becomes a customer in Mobiari and the visit joins their history. A sale paid later, even typed at the counter, is credited to the ad that was clicked.
  3. The contact goes as a lead to Meta, TikTok and GA4, and to Google Ads when the visit came from a Google click and the lead action is set. Visitors who turned ad cookies off are not sent.
  4. WhatsApp offers go only to those who ticked the box; Mobiari keeps when and how the person agreed.

In Grow → Marketing → Leads, the WhatsApp button box shows the taps on the button, the numbers given, the conversations started and the sales. To go back to the plain link, untick Pedir o WhatsApp do cliente antes de abrir a conversa in the Botão do WhatsApp section, in the site editor (Grow → Online store → Edit site).

8. Common questions

Why is the platform's number higher than Mobiari's? Platforms also count people who saw the ad and bought later without clicking. Mobiari counts by click, with the last source of the previous 30 days.

Does a refund change the ad's return? On Google Ads and GA4, yes: the sale's value is corrected or removed. Meta and TikTok do not accept that correction.

How long does Mobiari keep trying to send? If the platform does not answer, about two days for sales and half a day for other events. If it rejects, 3 more times over 14 hours. Never more than 7 days after payment. What did not arrive shows under Sales not reported.

On this page