Smler can forward every link click to Google Analytics 4 and Meta Pixel automatically — no JavaScript snippet or tag manager required. The integration runs server-side using the GA4 Measurement Protocol and Meta Conversions API, so it works for every click regardless of ad-blocker or browser privacy settings.
How it works
Pixel tracking is configured per custom domain. When a visitor clicks any short link under that domain, Smler fires the configured events to GA4 and Meta in the background before redirecting the visitor. The redirect itself is not delayed.
Setting up GA4 tracking
1. Create a GA4 API Secret
Open Google Analytics and go to Admin → Data Streams.
Select your web data stream.
Under Measurement Protocol API secrets, click Create and copy the secret value.
Your Measurement ID is shown at the top of the stream details page (format:
G-XXXXXXXXXX).
2. Configure in Smler
Run the following GraphQL mutation authenticated with your API key:
mutation {
upsertPixelConfig(
domain: "links.acme.io"
gaPropertyId: "G-XXXXXXXXXX"
gaApiSecret: "your-api-secret"
) {
id
domain
gaPropertyId
}
}From this point on, every click on a short link under links.acme.io fires a link_click event to your GA4 property.
GA4 event parameters
The link_click event is sent with the following custom parameters. You can register these as custom dimensions in GA4 to use them in reports and audiences.
Parameter | Description |
|---|---|
| The short code of the clicked link (e.g. |
| The custom domain the link was served from. |
| ISO 3166-1 alpha-2 country code of the visitor. |
| City of the visitor. |
| Device type: |
| Browser name, e.g. |
| Operating system, e.g. |
| Referring domain, e.g. |
| UTM source from the original link. |
| UTM medium. |
| UTM campaign. |
| UTM term. |
| UTM content. |
Setting up Meta Pixel tracking
1. Get your Pixel ID and access token
Go to Meta Events Manager.
Select your pixel and copy the Pixel ID.
Under Settings → Conversions API, generate a System User Access Token with
ads_managementandbusiness_managementpermissions.
2. Configure in Smler
mutation {
upsertPixelConfig(
domain: "links.acme.io"
metaPixelId: "1234567890123456"
metaAccessToken: "EAAxxxx..."
) {
id
domain
metaPixelId
}
}You can configure GA4 and Meta together in a single mutation by passing all four fields at once.
Meta event details
Smler fires a PageView event to the Meta Conversions API on each click. The payload includes:
client_ip_address— visitor's IP addressclient_user_agent— visitor's user agent stringcountry— SHA-256 hashed lowercase country code (per Meta spec)Custom data:
short_url,domain,referrer, and UTM parameters
Viewing and removing a pixel config
Query the current configuration for a domain:
query {
pixelConfig(domain: "links.acme.io") {
gaPropertyId
metaPixelId
updatedAt
}
}Remove all pixel tracking for a domain:
mutation {
deletePixelConfig(domain: "links.acme.io")
}Privacy considerations
No cookies are set. All tracking is server-side only.
For Meta, the country field is hashed (SHA-256) before transmission. IP and user agent are sent to Meta as-is — Meta hashes these on their end for storage.
Smler does not store your GA4 API secret or Meta access token in logs. They are stored encrypted in your account.
Ensure your privacy policy discloses server-side analytics tracking to your users.
Troubleshooting
Issue | Fix |
|---|---|
Events not appearing in GA4 DebugView | GA4 Measurement Protocol events are not shown in DebugView. Use the Realtime report and filter by event name |
Meta events show low match quality | Match quality improves if you also fire the browser-side pixel. Server-side events from Smler complement browser events — enable deduplication using the |
Mutation returns "Domain not found" | The domain must already be registered under your account in Domains. Only domains you own can have a pixel config. |
