Problem
Meta's pixel writes _fbp and _fbc on the registrable domain (for example .example.com) and encodes the level it used in the second segment of the value: fb.1. means example.com, fb.2. means www.example.com, fb.0. means com.
StoreFbpSubscriber and StoreFbcSubscriber create host-only cookies (no domain argument to Cookie::create()), while the SDK value objects default the subdomain index to 1. On a site served from www.example.com the result is a host-only cookie whose value claims to be a domain cookie. When a visitor moves between www.example.com, example.com or a checkout subdomain, the browser presents different cookies, and the browser pixel may write its own domain cookie next to the server one, producing two _fbp values for one person.
Suggested fix
Add configuration:
setono_meta_conversions_api:
cookies:
domain: null # e.g. '.example.com'; null = host-only
lifetime: '+90 days'
Set the subdomain index on generated Fbp/Fbc values accordingly (withSubdomainIndex(2) for host-only on a www. host, 1 when a domain cookie is configured). Meta's capi-param-builder ships an ETLDPlus1Resolver that shows the intended logic if auto-detection is preferred over configuration.
Related: #28.
Problem
Meta's pixel writes
_fbpand_fbcon the registrable domain (for example.example.com) and encodes the level it used in the second segment of the value:fb.1.meansexample.com,fb.2.meanswww.example.com,fb.0.meanscom.StoreFbpSubscriberandStoreFbcSubscribercreate host-only cookies (nodomainargument toCookie::create()), while the SDK value objects default the subdomain index to1. On a site served fromwww.example.comthe result is a host-only cookie whose value claims to be a domain cookie. When a visitor moves betweenwww.example.com,example.comor a checkout subdomain, the browser presents different cookies, and the browser pixel may write its own domain cookie next to the server one, producing two_fbpvalues for one person.Suggested fix
Add configuration:
Set the subdomain index on generated
Fbp/Fbcvalues accordingly (withSubdomainIndex(2)for host-only on awww.host,1when a domain cookie is configured). Meta'scapi-param-builderships anETLDPlus1Resolverthat shows the intended logic if auto-detection is preferred over configuration.Related: #28.