Skip to content

Document deduplication, what is sent, consent and worker mode - #55

Open
loevgaard wants to merge 1 commit into
fix/33-housekeepingfrom
fix/31-readme
Open

Document deduplication, what is sent, consent and worker mode#55
loevgaard wants to merge 1 commit into
fix/33-housekeepingfrom
fix/31-readme

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Fixes #31

Stacked on #54.

The earlier PRs in this series already added the pipeline table, the enrichment example, the logging channel, the async routing rationale and the test event code lifecycle. This one closes the remaining gaps from the issue.

Deduplication between the browser and the server

With both sides on, the same event is sent twice on purpose. Nothing said so, or explained why that is fine: Event::$eventId is generated in the constructor and used as eventID in the fbq() call and event_id in the api payload, so Meta collapses the pair. Also spells out the one case where it breaks, namely assigning ids yourself and not using the same one on both sides.

What is sent to Meta

A table of the four fields the bundle fills in by itself, plus the two things worth checking in the application:

  • framework.trusted_proxies has to be configured, or getClientIp() returns the load balancer's address and every visitor looks identical.
  • event_source_url is the full url including the query string, with a one-line listener for stripping it.

Also states that personal data is hashed before it leaves the server and is not written to the transport.

Consent

What actually happens while consent is not granted: events are still built and enriched, but no tags are rendered, no command is dispatched, and neither cookie is written, each logged at debug level. And that everything counts as granted when the consent bundle is absent or the option is off.

Long running runtimes

Requirements now state that FrankenPHP worker mode, RoadRunner and Swoole are supported, since the cached contexts are reset between requests.

@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.97%. Comparing base (05661e3) to head (c8953ac).

Additional details and impacted files
@@                  Coverage Diff                   @@
##             fix/33-housekeeping      #55   +/-   ##
======================================================
  Coverage                  81.97%   81.97%           
  Complexity                   171      171           
======================================================
  Files                         35       35           
  Lines                        538      538           
======================================================
  Hits                         441      441           
  Misses                        97       97           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Fill the remaining gaps in the README: how the browser and server events
are deduplicated, exactly which request data is sent to Meta and the
trusted_proxies and query string caveats that come with it, what happens
while consent is not granted, and that long running runtimes are
supported.

Fixes #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant