Skip to content

v1.2.0

Latest

Choose a tag to compare

@loevgaard loevgaard released this 14 Sep 07:15
36270b7

Highlights

  • Fbc/Fbp now parse the cookie values Meta writes today (#13). Two real-world shapes were previously rejected:

    • click ids containing - or _ — real fbclid values are base64url, e.g. fb.1.1657051589577.IwZXh0bgNhZW0CMTAAAR-uK_5w;
    • the trailing appendix segment that Meta's own parameter builder (facebook/capi-param-builder-php) appends, e.g. fb.1.1657051589577.1088522659.AQEAAQMB.

    The _fbp case was the damaging one: the rejected value made servers fall back to generating a fresh fbp on every request, silently degrading Event Match Quality while the browser held a stable value.

  • Byte-for-byte round-tripping — new Fb::getAppendix() / Fb::withAppendix(), and value() writes a parsed appendix back unchanged, so a value read from a cookie is never rewritten into a different shape. The appendix is carried, not interpreted.

Compatibility

No backwards-compatibility breaks. value() only gains a fifth segment for values that were parsed with one; existing four-segment values round-trip exactly as before. One deliberate behavioural change: click ids with -/_ (previously rejected) are now accepted — that is the fix.

Under the hood

  • Test coverage stays at 100 % line coverage with a 94 % mutation score: base64url click ids, both appendix lengths round-tripping for Fbc and Fbp, appendix survival through the immutable setters, and rejection of malformed appendixes.

Requirements

Full changelog: v1.1.0...v1.2.0