Skip to content

feat: attribute book buy-clicks to the on-page CTA - #435

Open
dwmkerr wants to merge 1 commit into
mainfrom
feat/book-cta-location-tracking
Open

feat: attribute book buy-clicks to the on-page CTA#435
dwmkerr wants to merge 1 commit into
mainfrom
feat/book-cta-location-tracking

Conversation

@dwmkerr

@dwmkerr dwmkerr commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a data-book-cta attribute to every Amazon / No Starch link (chapter lead banner, chapter footer, homepage hero and nav) so book buy-clicks can be attributed to which on-page CTA they came from.
  • GTM (GTM-WS7KMPTS) reads it into a link_location parameter on the amazon_click / nostarch_click events, surfaced in GA4 as the event-scoped custom dimension Book CTA location. Toolbar and site-footer links are matched by class / container instead (they're config-driven and can't take the attribute), so no navbar/footer config change is needed.
  • Documents the whole setup in the README under "Analytics".

Attribution is forward-only (GA4 can't backfill) and a missing attribute never breaks tracking — the click still fires, it just reports (unmarked). The GTM container and GA4 custom dimension are already live.

Add a data-book-cta attribute to every Amazon / No Starch link (chapter
lead banner, chapter footer, homepage hero and nav). GTM reads it into a
link_location event parameter on the amazon_click and nostarch_click
events, surfaced in GA4 as the 'Book CTA location' custom dimension, so
buy-clicks can be split by where on the page they came from.

Menubar links are matched by their existing header-* class, so the navbar
config is untouched. Document the setup in the README.
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://dwmkerr.github.io/effective-shell/pr-preview/pr-435/

Built to branch gh-pages at 2026-09-02 13:29 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

2 participants