Now I have the full picture. I need to:
layout.tsx (global head)<a href="#oferta"> anchor links to append current URL query params dynamically<a href="...kiwify..."> to also append current URL paramsSince the page is a Client Component ("use client"), I can use a useEffect to read URL params and dynamically update all CTA hrefs. Let me implement this cleanly:
Now update page.tsx to capture URL params on mount and append them to all CTA anchor href attributes:
Now update the hero CTA to use checkoutUrl for the checkout button, and keep the scroll buttons as #oferta (no params needed for anchors):
The implementation is complete. Two UTMify scripts (UTMs persistence and pixel) are added to layout.tsx so they load globally on every page via Next.js <Script> with strategy="afterInteractive". In page.tsx, a useEffect captures the full query string on mount and stores it in state — the checkoutUrl variable then appends it to the Kiwify checkout link, ensuring all UTM parameters, fbclid, gclid, src, sck, and any other tracking params are preserved when users click the purchase CTA.
Everything is already correctly in place from the previous implementation. Let me verify the current state:
Already implemented:
utmify-utms) in layout.tsxutmify-pixel) in layout.tsxqueryString state captured via useEffect in page.tsxcheckoutUrl dynamically appends query params to the Kiwify linkhref="#oferta" (anchor, no params needed)href={checkoutUrl}The only thing to verify is that the data-utmify-prevent-xcod-sck and data-utmify-prevent-subids attributes are properly set as boolean attributes (not empty strings) per the spec. Let me fix that:
All tracking requirements are already implemented and now fully aligned with the spec. The UTMify UTMs script now uses proper boolean attributes (data-utmify-prevent-xcod-sck, data-utmify-prevent-subids, async, defer) as specified. The queryString captured on mount in page.tsx ensures all URL parameters (UTMs, fbclid, gclid, src, sck, etc.) are safely appended to the Kiwify checkout URL on every CTA click, with no risk of duplication or malformed URLs.