Pixelex.Destinations.Meta (Pixelex v0.1.0)

Copy Markdown View Source

Meta Conversions API.

Mirrors browser-pixel conversions from the server so they still land when the visitor blocks the pixel, and deduplicates against the browser fbq('track', …, {eventID: id}) through a shared event_id.

Credentials

%{pixel_id: "123…", access_token: "EAA…", test_event_code: "TEST1234"}

test_event_code shows the event in Events Manager's test tool without it counting — the only way to verify the payload shape without spending real attribution on a guess.

fbc

Meta matches a server conversion to the ad that paid for it through fbc, built from the fbclid captured at the click:

fb.1.<unix_ms>.<fbclid>

Pixelex.Attribution captures the fbclid; fbc/2 builds the string. Pass the raw click id as user_data.fbclid and this does the rest. Without it a conversion is attributed to nothing, which is the same as not sending it.

Summary

Functions

Meta's click-id format: fb.1.<unix_ms>.<fbclid>.

Functions

fbc(fbclid, clicked_at_ms \\ nil)

@spec fbc(String.t() | nil, integer() | nil) :: String.t() | nil

Meta's click-id format: fb.1.<unix_ms>.<fbclid>.

The 1 is the subdomain index and is not a version. The timestamp should be when the click happened, not when the conversion did — Meta uses it to place the click in an attribution window, so passing now for a click from three days ago quietly narrows the window it can match in.