4based/API
← 4based ads tracking
4based

4based Google Ads conversion tracking

4based Google Ads conversion tracking sends every 4based subscription, PPV purchase and tip to Google Ads server-side, with the original gclid click ID and deduplication built in.

Request accessLast updated:

4based Google Ads conversion tracking is the server-side bridge between your 4based tracking links and your Google Ads ad account. This guide explains how the integration works, what you need before you start, how to set it up step by step, and how to verify that every conversion is counted exactly once.

Browser-only tracking misses a large share of conversions on creator platforms: fans click an ad on mobile, land on a tracking link, and subscribe later inside an in-app browser or on another device. Cookie restrictions, ad blockers and iOS privacy features break the chain. Server-side events from 4based API close that gap by sending the conversion directly from our infrastructure to Google Ads, tied back to the original click.

4based API is an independent developer platform. The 4based events described here are part of the 4based API product's normalized event model and are delivered through your own Google Ads credentials.

What you get

  • Server-side Google Ads conversions for subscriptions, renewals, PPV purchases and tips
  • Automatic gclid capture on every 4based tracking link
  • Deduplication against the browser tag with one shared event_id
  • Per-creator ROAS, CPA and LTV reporting in the 4based API dashboard

How does 4based Google Ads conversion tracking work?

  1. 1

    Ad click

    A fan taps your Google Ads ad and Google Ads appends gclid to the URL.

  2. 2

    Tracking link

    Your 4based tracking link saves gclid as a first-party value for 90 days.

  3. 3

    4based conversion

    The fan subscribes, renews, buys a PPV message or sends a tip on 4based.

  4. 4

    4based API

    We hash identifiers, assign one event_id, apply consent and sign the event.

  5. 5

    Google Ads

    The event is posted to Google Ads and appears in reporting within minutes.

Before you start

  • An active Google Ads ad account with admin or advertiser access
  • Your conversion action ID
  • A Google Ads account connection (OAuth)
  • At least one 4based tracking link for the creator you are promoting
  • A 4based API key from your dashboard (request access if you do not have one yet)

Step-by-step setup

  1. 1. Create a conversion action

    In Google Ads open Goals, then Conversions, and create a website conversion action for subscriptions. Choose to import conversions from clicks so uploads are accepted. Repeat for purchases if you want separate reporting.

    Conversion action: 4based Subscribe

    Status: Active

    Source: Website

  2. 2. Generate the access token

    Google Ads uses OAuth instead of a static token. In the next step you sign in with the Google account that manages the ad account and grant 4based API permission to upload conversions.

    OAuth scope: adwords

    Created: today

    Permissions: send events

  3. 3. Connect in the 4based API dashboard

    Open Ads Tracking in the dashboard, choose Google Ads, paste the conversion action ID and token, and pick which creators the connection applies to. 4based API validates the credentials immediately.

    Google Ads: Connected

    Creators: 3 selected

    Validation: OK

  4. 4. Add the tracking link to your ads

    Use your 4based tracking link as the destination URL in every Google Ads ad. Do not strip query parameters: gclid must reach the landing page. Add the click capture snippet below if you host your own landing page.

    Destination: link.example.com/summer

    Auto-tag: gclid on

    UTM: preserved

  5. 5. Map 4based events

    Review the default mapping from 4based events to Google Ads events and turn on the events you want to optimize for. Values and currency are filled in automatically from the transaction.

    Subscribe: on

    Purchase (PPV, tip, renewal): on

    Lead: on

  6. 6. Send a test event

    Use Google Ads > Goals > Conversions > Diagnostics to get a test code, paste it into the dashboard and send a test event. A good result appears within a minute and shows the expected identifiers.

    Test event: Purchase

    Status: Received

    Matched identifiers: 4

Capture the click ID

Fans may convert hours or days after the click, so gclid must survive the session. If you use a 4based API hosted tracking link this happens automatically. If you run your own landing page, add this snippet. It reads gclid from the URL and stores it in a first-party cookie for 90 days.

capture-click-id.ts
// capture-click-id.ts - runs on your tracking-link landing page
const PARAMS = ["gclid", "gbraid", "wbraid"];
const NINETY_DAYS = 60 * 60 * 24 * 90;
const url = new URL(window.location.href);
for (const name of PARAMS) {
  const value = url.searchParams.get(name);
  if (!value) continue;
  document.cookie = `4b_${name}=${encodeURIComponent(value)}; Max-Age=${NINETY_DAYS}; Path=/; SameSite=Lax; Secure`;
}
// The 4based API tracking link reads this cookie and stores the click ID with the fan.

Event mapping

The table shows how each 4based event maps to Google Ads, with required and recommended parameters. Required parameters are always sent; recommended parameters are sent when the data is available and consent allows it.

4based eventGoogle AdsRequiredRecommended
Tracking link click(page_view)GA4 only: client_id, page_locationgclid, gbraid, wbraid
Free follow / signupsign_upconversion_action, conversion_date_timehashed email
New subscriptionsubscribe (conversion)gclid or gbraid/wbraid, conversion_value, currency_codeorder_id
Renewalpurchaseconversion_value, currency_code, conversion_date_timeorder_id
PPV message purchasepurchaseconversion_value, currency_codeorder_id
Tippurchaseconversion_value, currency_codeorder_id

Full payload example

You call one 4based API endpoint (POST https://api.4basedapi.com/v1/ads/google/conversions). 4based API translates it into the Google Ads request (ConversionUploadService.UploadClickConversions). The examples below send a purchase event in cURL, TypeScript and Python.

curl -X POST https://api.4basedapi.com/v1/ads/google/conversions \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "123-456-7890",
    "conversion_action": "customers/1234567890/conversionActions/987654",
    "gclid": "<gclid>",
    "conversion_date_time": "2026-10-07 14:02:11+00:00",
    "conversion_value": 9.99,
    "currency_code": "USD",
    "order_id": "4based_sub_abc123",
    "user_identifiers": [{ "hashed_email": "<sha256(email)>" }],
    "consent": { "ad_user_data": "GRANTED", "ad_personalization": "GRANTED" },
    "ga4": { "measurement_id": "G-XXXXXXXXXX", "event": "purchase" }
  }'

How are gclid, gbraid and wbraid handled?

Google appends gclid to most web clicks, while iOS traffic can carry gbraid (app to web) or wbraid (web to app) instead. The landing script captures whichever parameter is present and 4based API stores it with the fan. When the fan converts, the conversion is uploaded with the matching identifier so Google can attribute it even when a gclid is missing.

For uploads 4based API uses the Google Ads API ConversionUploadService.UploadClickConversions method with conversion_action, conversion_date_time in the format yyyy-mm-dd hh:mm:ss+00:00, conversion_value and currency_code. The order_id is set to the event_id so the same conversion is never counted twice.

Enhanced conversions and GA4

Enhanced conversions for web add a SHA-256 hash of the fan's normalized email to the upload, which lets Google recover conversions where the click identifier was lost. Teams that also use GA4 can mirror the same events through the Measurement Protocol at POST https://www.google-analytics.com/mp/collect?measurement_id=...&api_secret=..., sending sign_up, subscribe and purchase with value and currency.

Consent Mode v2 requires ad_user_data and ad_personalization signals. 4based API passes the fan's recorded consent with every upload and withholds hashed identifiers when advertising consent is missing.

Deduplication

If you run the Google Ads browser tag alongside server events, both will report the same conversion. To avoid double counting, both must carry the same identifier: event_id, sent to Google as order_id.

4based API generates the event_id from the 4based transaction, for example 4based_sub_abc123 for a subscription or 4based_ppv_msg5531 for a PPV purchase. If you fire the browser event yourself, read the same value from the tracking-link data layer and pass it to the browser call.

Google Ads keeps the first event it receives and discards later duplicates within its deduplication window. Server events usually arrive first, so the browser event mainly adds extra signal.

Matching and privacy

Emails are trimmed, lowercased and hashed with SHA-256 before they leave 4based API. Phone numbers are normalized to E.164 and hashed the same way. Raw personal data is never sent to any ad platform.

Fields sent to Google Ads: hashed email when available, gclid, _gcl_aw when present, client IP address and user agent from the click, event_id, value and currency. Nothing else is sent.

Consent is respected end to end. 4based API reads IAB TCF v2.2 strings and Google Consent Mode v2 signals recorded on the tracking link. Without advertising consent, hashed identifiers are withheld, and in consent regions the event is blocked entirely. Hashing is not anonymization, so treat hashed identifiers as personal data.

Test and verify

Open Google Ads > Goals > Conversions > Diagnostics. Copy the test code and paste it into the Google Ads connection in the 4based API dashboard, then click Send test event.

A good result shows the event within a minute with the correct event name, value and currency, plus at least the click ID and one more identifier. Remove the test code once you are done, otherwise live events may be routed to the test view.

After going live, compare conversions in Google Ads with the 4based API dashboard for the same day. Differences under 5 percent are normal because of attribution windows and time zones.

Troubleshooting

SymptomCauseFix
No events in test viewTest code missing or expiredGenerate a new test code and paste it again
Events arrive without gclidQuery parameters stripped by a redirectUse the tracking link directly as the ad destination
Conversions counted twiceBrowser and server events use different IDsPass the same event_id to the browser call
Invalid token errorToken revoked or for another accountGenerate a new token and reconnect
Low match qualityMissing IP, user agent or emailEnable click context capture and hashed email with consent
Wrong currency or valueCreator currency not setSet the default currency per creator in the dashboard
Events blockedNo advertising consent recordedCheck the consent banner on your landing page

Frequently asked questions

Create a conversion action in Google Ads, connect your account in the 4based API dashboard and add your tracking link to your ads. 4based API uploads conversions with the captured gclid and hashed email for enhanced conversions.

Build with 4based API

Ready to build?

Tell us what you want to automate, measure or build on top of 4based. Agencies, developers and automation teams all get a tailored next step from our team.