Attribution and conversions: where each contact and each sale comes from
This part of Tracking answers four questions: which ad or link did each person come from, how many leads and sales do I have, how long do they take to buy, and how do I tell Google Ads, GA4, or Meta about what happens outside the web? It’s off by default. Inside Tracking there are two products: ServerTrack (Settings, Rules, Destinations, Conversions, WhatsApp, and Reconcile sales) and Analytics (Visits).
How it works, plainly. A small, asynchronous beacon, which doesn’t delay the page, notifies your server when the browser has finished loading the page. The server saves the visit in your site’s tables: the ad click identifiers (gclid, gbraid, wbraid, fbclid, msclkid), the utm_* tags, the landing page, and where the visitor came from. It doesn’t change cached pages or delay loading. To recognize the same browser on a later visit, a first-party cookie with a random identifier (bos_vid) is needed. That cookie carries no personal data, but it’s still a cookie: we don’t claim it uses no cookies, and your region’s consent rules apply.
Privacy policy. You must mention in your privacy policy: the bos_vid cookie, that you store the origin of visits for the number of days you choose, and that you may send conversion data to Google, Meta, or other providers you configure. BuilderOS can’t write that for you.
Consent. If you turned on BuilderOS’s cookie banner (or Google consent mode for an external manager), the beacon sends nothing until the banner grants advertising (ad_storage) or analytics (analytics_storage) permission. If you use another banner, signal it with window.bosAttribution.consent(true) (or false) or with the bos:consent event. If the visitor doesn’t accept, nothing from that visit is saved. You can remove that wait with the checkbox in the Attribution tab, but then consent is your responsibility.
Advertising consent in destinations. With consent mode on, BuilderOS stores what each visitor chooses in the banner about ad_user_data and ad_personalization (only their choice counts; the site’s default values don’t, and anyone who doesn’t touch the banner stays as “unknown”), and each sale or lead keeps it. In Google Ads: direct upload, if they granted it, consent travels with the hashed email and phone; if they denied it, the refusal is declared and no personal data is sent; if it isn’t known, no personal data is sent. In Meta, the hashed email and phone are only sent if they granted it; if they denied it nothing is sent, and if it isn’t known the event is sent without them. With consent mode turned off, hashed data is sent, but BuilderOS never claims that consent exists, and the destination form warns you. If your site uses a banner with Google Consent Mode, leave consent mode on.
Step 1: turn it on. Go to BuilderOS → Tracking → ServerTrack: Settings, check Activate, choose how many days the visitor is remembered (90 by default) and how long visits are kept (180) and click Save. From here on, every form, contact, and deal that originates from a visit stores its source. You’ll see it in each message’s detail and in the contact’s record, in the Source and sales card.
Step 2: create rules. In Rules click Create the recommended rules (lead by form, sale by won deal, sale by order) or create your own. A rule has a trigger (form submitted, deal won or reaching a stage, store order, viewing a page, clicking an element, custom event), optional conditions (for example “source is google”), where the value comes from, and the role: Lead, Sale, or Other metric. Those with the “Other metric” role appear in the report as Your metrics.
Step 3: choose destinations. In Destinations add where to send:
- Google Ads: offline conversions CSV. You download a file and upload it yourself.
- Google Ads: HTTPS feed. A fixed address with its own username and password (shown only once when created) for Google Ads’ scheduled uploads.
- Google Analytics 4. Measurement ID and API secret; the submission goes out from the server.
- Meta: Conversions API. Pixel ID and token; the email and phone are sent hashed.
- Custom webhook. An address of your own, with an HMAC signature and the fields you choose.
Secrets are stored encrypted and never shown again. Submissions go out in the background with retries; if one fails, the web doesn’t even notice, and you’ll see the reason in the Pending deliveries card, with a button to retry. On each active destination you can click Send a test.
Upload conversions to Google Ads with the CSV.
- In Google Ads create a conversion action of type Import → Other data sources or CRM → Upload files (note its exact name).
- In the rule, type that exact name in Conversion action in Google Ads.
- In Tracking → Conversions, at the bottom, Upload to Google Ads card, click Download CSV (Google Click ID). The downloaded conversions are marked “sent”.
- In Google Ads: Goals → Uploads → Upload file, choose the CSV and upload.
- If you downloaded something by mistake, Also download again the ones already exported includes it again.
Only conversions that carry a Google click (gclid, gbraid, or wbraid) can be uploaded; the rest appear as “no Google click”. Google accepts conversions during your conversion action’s window (up to 90 days after the click): anything beyond it isn’t exported (see “Conversion window”). gbraid and wbraid clicks go in a second CSV.
Upload with the scheduled feed. Create the “HTTPS feed” destination, copy the address, username, and password (they’re only seen once) and in Google Ads, Uploads → Schedules, choose HTTPS and enter that data. Google reads the address each time it’s due.
Reports. In Conversions you choose a period and see leads, sales, revenue, average ticket, close rate, percentage of conversions with an identified click, new visitors, and the time to close (average, median, and breakdown). Also by source and by campaign and your own metrics, compared with the previous period. You can download the CSV. If there’s no data yet, the screen says so: nothing is made up.
With the CRM active each form saves the source on the contact and on its deal, and when a deal is won the sale is recorded with its value. Without the CRM there’s no automatic sale: use Record sale (in the contact’s record) or your AI.
With your AI. The Attribution and conversions tool group lets it read reports and conversions, create rules and destinations (without being able to read secrets), record events and sales, and export the CSV. It can also do a preview of a sales reconciliation (writing nothing) and apply it afterward, and record sales. In Read only mode only reading remains (reports, rules, destinations without secrets, conversions, and the preview).
All of this works without BuilderOS’s CRM. Leads, ad clicks, rules, destinations, and reports live in Tracking’s own tables. If you turn on the CRM, the source is also saved on each contact and each deal; if you have another CRM, you don’t need to turn ours on.
WhatsApp: capture the phone before opening the chat. In Tracking → WhatsApp you can turn on a window that appears when clicking any link to wa.me, api.whatsapp.com, or wa.link (the domains can be changed). It asks for the phone, with a country selector if you set it up, and an optional question (with closed answers or free text); then it sends the person to WhatsApp without delays. The countries, their prefixes, and each number’s validation rules are written by you, one line per country (ES|España|34|9|9, and optionally a regular expression); there are none by default. Each lead is saved with its source (ad click included), counts as a lead in the reports, and sends the bos_whatsapp_lead event to dataLayer, without the phone. The window is only downloaded when someone clicks a WhatsApp link, so it doesn’t affect page speed.
Reconcile sales closed in another system. In Tracking → ServerTrack → Reconcile sales:
- Sales CSV. Upload the CSV from your other CRM (comma, semicolon, or tab). BuilderOS detects the columns (email, phone, value, date, status, identifier) or you specify them. You can say which statuses count as won. Before applying you see a preview: how many sales would be recorded, with a lead found or not, those that already exist, and the ambiguous ones. A row is ambiguous when its email and phone point to different people; it isn’t applied, and you resolve it by adding a
lead_idcolumn. When you click Apply, each sale is matched to its lead (by normalized phone or email, or bylead_id), recovers its historical click, leaves the lead marked as converted with its value and date, and is queued for your sales rules’ destinations. - Real-time notice. Generate a key and have your other system call the address shown by POST, with the key in
X-BuilderOS-Keyand a JSON withlead_id(oremailorphone),value,currency,date,ref, andstatus. The samerefisn’t recorded twice. The key is only shown when it’s generated. - Round trip. To send each lead to your other CRM, create a Custom webhook destination on a lead rule: the body includes the
lead_id, and your other system returns it when reporting the sale.
Google Ads: direct upload (Data Manager API). In Destinations add “Google Ads: direct upload (Data Manager API)” with your customer ID, the conversion action ID, and your OAuth2 credentials (client ID and secret and refresh token). It doesn’t need a developer token. They’re stored encrypted, access renewal is automatic, and the Send a test button checks the connection without uploading anything real. It sends the email and phone hashed with SHA-256 (enhanced conversions; the phone in international format: set a default prefix in Attribution if your forms don’t include it) and, if the conversion time were earlier than the click, it corrects it so Google accepts it. If you installed BuilderOS before and had already authorized this upload, you have to click Authorize with Google again: the form warns you. When you delete the destination, access is revoked at Google. Failures of a specific conversion are shown in Pending deliveries, with retries only when it makes sense. While Google processes a batch, the delivery may show a message that starts with “Data Manager: …” (for example, that there’s no confirmation yet or that it was confirmed).
Conversion window. In Google Ads destinations (CSV, HTTPS feed, and direct upload) you can set the window in the Conversion window from the click (days) field (90 by default), which must match your conversion action’s window. The feed, the CSV (including the gbraid and wbraid one), and the direct upload leave out clicks that were already older than that window when they converted; the destination panel counts them as Excluded by window. No data is deleted: it stays in your reports.
Delete a person’s data. There are two ways: in WordPress → Tools → Erase Personal Data, with the person’s email (to give them their data, use Tools → Export Personal Data), or by deleting their contact in the CRM. The deletion starts only from the person’s email: it deletes the visits, WhatsApp leads, and sales linked to them, but never those of another person who shares the same device or phone (for example, a relative’s lead with the same number). The Tools → Export Personal Data exporter includes the same data: conversions, WhatsApp leads, visits, and events.
Windows. In the conversions list a notice appears when a pending conversion is outside the destination’s window: Meta accepts events from the last 7 days, GA4 keeps the original date up to 72 hours, and Google Ads depends on your conversion action’s window (up to 90 days from the click; adjust it in the destination). Google also warns that conversions from less than a day ago may not be registered yet.
More metrics. The report adds the mature close rate (only leads at least as old as the days you set in Attribution, so recent ones aren’t penalized), closes in under 24 hours, in 1 to 3 days, and in more than 3, and a ranking by your own dimension (for example product size): in the rule, set the form or contact field whose value you want to compare and name it in Attribution. Sales inherit the dimension of their lead. Report data comes from a daily totals table, so opening the screen is fast.
How long data is kept. Individual visits are kept for the days you set (180 by default); leads with their click, separately, 730 days by default (0 = forever), because a sale can arrive months later.
Two methods to upload sales to Google Ads, step by step. For both, the same is needed before you start:
- Auto-tagging: in Google Ads, Admin → Account settings → Tracking → Auto-tagging, turn it on. That way ads carry the
gclidthat BuilderOS stores. - Create the import conversion action: in Goals → Conversions → Summary → New conversion action → Import → Other data sources or CRM → Track conversions from clicks. Give it a name (copy it identically in BuilderOS’s rule, in “Conversion action in Google Ads”), choose Use different values for each conversion, the count One (one sale per click), and a click conversion window of 90 days. After creating the action, wait 4 to 6 hours before uploading conversions for it. For enhanced conversions for leads, accept the customer data terms Google asks for.
- In BuilderOS, on a sale rule, type that exact name and choose the destination.
Method A (recommended): scheduled uploads over HTTPS, no API credentials. It’s the simplest route and the one best verified end to end.
- In ServerTrack → Destinations add “Google Ads: HTTPS feed” and click Save destination. BuilderOS shows you only once the address, the username, and the password.
- In Google Ads: Goals → Conversions → Uploads → Schedules → + button.
- Under Source choose HTTPS. Type the address in the file field and the username and password in their fields. Don’t put the key inside the address: Google has its own fields for the username and password, and that way it isn’t written in any URL.
- Choose Frequency and Time, click Save and get preview and Accept.
- Google reads the file on each schedule. Each sale is delivered only once: the next day’s read only brings the new sales, so none is repeated.
Method B (optional): direct upload with the Data Manager API, automatic sending without files. It needs a Google Cloud project. Method A remains the recommended one: it’s simpler and doesn’t require credentials.
- In console.cloud.google.com create a project and enable the Data Manager API.
- OAuth consent screen: set it up (internal type if your account is Workspace, or external in production with your account as a test user) and in the permissions (scopes) add
https://www.googleapis.com/auth/datamanager. - Credentials → Create credentials → OAuth client ID → Web application. In “Authorized redirect URIs” paste exactly the one BuilderOS shows in the “Google Ads: direct upload (Data Manager API)” destination (it’s visible on that screen).
- Copy the client ID and secret.
- In ServerTrack → Destinations → Google Ads: direct upload (Data Manager API), type the Google Ads customer ID (10 digits, no dashes), the conversion action ID (the
ctIdnumber in its address), the OAuth client ID and secret and, if needed, the manager account ID. Save. - Click Authorize with Google, choose the account, and accept all permissions. BuilderOS stores the refresh token encrypted. If you already had this upload configured before, repeat this step. When you Delete the destination, BuilderOS also revokes access at Google.
- Click Send a test: it should say “Connection successful”.
- Leave Automatic sync on checked: each new sale is uploaded on its own, with the click, the value, and the hashed email and phone (enhanced conversions).
Sections inside Tracking. (The cookie banner has its own: see “Cookie banner”.) TrackAssist (connections and events), ServerTrack (capture, rules, destinations, conversions, WhatsApp, and reconciliation) and Analytics (visits, pages, sources, campaigns, devices, and countries if your server reports them). Both use a single small beacon and load nothing else on your web. ServerTrack is an in-house alternative to server-side tracking services for the usual case: events go to your own site and your server forwards them to Google Ads, GA4, Meta, or another system, with retries. It is not a Google Tag Manager server container and doesn’t run its templates, and its capacity depends on your hosting (each measured visit is a PHP request to your server). Meta receives a stable event identifier (bos-<número>) so duplicates with the browser pixel can be avoided when you send the same identifier from it.
The recommended flow with an external CRM, from start to finish (web → live webhook → your CRM → webhook to BuilderOS → Google Ads via method A).
- Someone arrives from an ad: the beacon saves the click.
- They click the WhatsApp link: the window asks for their phone, BuilderOS saves the lead with a Ref ID (for example
REF-123) and adds it to the WhatsApp message that opens. If the “whatsapp-lead” rule is off, the Ref ID ends in “W” (for exampleREF-123W). - A Custom webhook destination (with “Include the phone, the email, and the Ref ID”) sends your other CRM the phone, the click, the Ref ID, and the source.
- Your CRM closes the sale and notifies BuilderOS (through the sales webhook or with a CSV), indicating the phone or the Ref ID.
- BuilderOS matches the sale to the lead and uploads the conversion with the click, the value, and the hashed identifiers. The sale inherits the lead’s hashed email and phone (never in the clear), so enhanced conversions also work when the match was by Ref ID.
Speed and self-protection. The beacon doesn’t delay your page: it’s sent when the browser is idle and reaches a BuilderOS file of its own that loads only the minimum of WordPress (no plugins or theme), saves the visit in a queue with a single write, and responds without waiting. The rest (visitors, totals, rules) is processed in the background every minute in small batches. If that file can’t be used on your server, BuilderOS automatically uses the standard route, somewhat slower. In ServerTrack → Settings you see the capacity of this server with real measurements from your site: events per minute, beacon time (p95), pending queue, and a verdict: Recommended, Recommended with sampling, or Use conversions only. If the beacon takes longer than you set (150 ms by default) or too many events arrive (600 per minute by default), BuilderOS counts only a portion of the visits without an ad and pauses Analytics detail; if the load keeps rising, it counts only arrivals with an ad click and conversions. Leads, sales, and conversions are never discarded, and it returns to normal only after five quiet minutes. The limits can be changed. If your site receives sustainably much more traffic than your server can handle, use an external service for visits and leave only conversions to ServerTrack.
Permissions: view reports and rules, administrators or anyone with permission to view the CRM; export, administrators or the CRM’s export permission; record sales, administrators or CRM managers; change settings, rules, and destinations, administrators only.