Retargeting pixels
A retargeting snippet fires when a link is clicked, before the redirect — even when the destination is a store the creator does not own. The snippet is the provider's own embed and renders verbatim on the interstitial, so the provider allowlist is the entire guard: a snippet that does not mention its provider's host is refused at write time.
Providers
| Key | Display name |
|---|---|
meta | Meta Pixel |
google | Google Ads |
tiktok | TikTok Pixel |
snap | Snap Pixel |
pinterest | Pinterest Tag |
Provider keys are normalized server-side; anything else is rejected. Snippets are capped at 8 KB.
The routes
| Method | Path | Scope |
|---|---|---|
GET | /links/{id}/pixels | links:read |
POST | /links/{id}/pixels | links:write |
DELETE | /links/{linkID}/pixels/{id} | links:delete |
# List — one entry per configured provider
curl https://lsg.bio/api/v1/links/6cb5cd5b-a2c8-4238-b548-b25991bc0559/pixels \
-H "Authorization: Bearer lsgbio_YOUR_TOKEN"
# { "pixels": [{ "id": "...", "link_id": "...", "provider": "meta",
# "display_name": "Meta Pixel", "eu_excluded": false }] }
# Set (create or replace) one provider's snippet
curl -X POST https://lsg.bio/api/v1/links/6cb5cd5b-a2c8-4238-b548-b25991bc0559/pixels \
-H "Authorization: Bearer lsgbio_YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"provider": "meta", "snippet": "<script src=\"https://connect.facebook.net/en_US/fbevents.js\"></script>", "eu_excluded": true}'
# 201 { "pixel": {...} }
# Remove it
curl -i -X DELETE https://lsg.bio/api/v1/links/6cb5cd5b-a2c8-4238-b548-b25991bc0559/pixels/a3bb1893-5c9e-4f1c-9b2d-7e6f5a4b3c2d \
-H "Authorization: Bearer lsgbio_YOUR_TOKEN"
# 204, no body
The snippet itself is never listed back — responses carry the provider
metadata only. eu_excluded skips EU visitors when set.
GET /links/{id}/pixels is not paginated, and does not need to be: one
snippet per provider per link, so a link holds at most 5 pixels — one per
supported provider above. The list is therefore always complete. At the bound,
posting another provider re-points that provider's existing snippet rather than
adding a sixth; an unsupported provider name is 400 / validation_failed.