feat: add X Ads download conversion tracker to DownloadAdDialog#748
Merged
Conversation
- Add X pixel event firing (twq('event', 'tw-ov0j6-ov0j9', {})) on download clicks
- Inject X conversion tracking base code only for pages with download content (conditional on downloadAdPopup frontmatter, prod only)
- Mirror gtagFn pattern with xPixelFn (dev logging + safe prod stub/queue)
- Update tests to cover new X pixel path
- Verified: non-download pages (index, most essays/diary) have no X tracker code; only download-link pages do
- Non-visual change; no screenshots required per AGENTS.md
4d0e9c4 to
5c60800
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
��## Summary
Add X (Twitter) Ads conversion tracking specifically for downloads.
DownloadAdDialog.downloadAdPopup: truevia the download link plugin).Changes
app/components/DownloadAdDialog.tsx: ExtendedsetupDownloadAdPopupwith optionalxPixelFn.app/client.ts: AddedxPixelFn(prod: callstwq, dev: logs; includes safe queuing stub).app/components/RootLayout.tsx: Added conditional X base code snippet (onlyPROD && downloadAdPopup).app/components/DownloadAdDialog.test.ts: Added tests for the new X pixel firing path (both alone and together with GA).Verification
/essays/download-link*,/works/download-link-test) contain the X base code.twq,ov0j6, or "X conversion tracking".This is a non-visual / analytics-only change (no screenshots needed per AGENTS.md).
Code installed
(The base code is loaded once per qualifying page; the event is fired from the JS download handler.)