Phase 3: Analytics conversion tracking, campaign plan + contact-form fix#25
Draft
willyd61 wants to merge 1 commit into
Draft
Phase 3: Analytics conversion tracking, campaign plan + contact-form fix#25willyd61 wants to merge 1 commit into
willyd61 wants to merge 1 commit into
Conversation
…, contact-form UX fix Phase 3 — analytics & campaign readiness. Conversion tracking (js/pleasure-island-scripts.js): - New trackConversion() fires semantic GA4 key events — generate_lead (contact), newsletter_signup, request_consultation (booking link), phone_call (tel:) — replacing the ad-hoc form_submit event, plus email_click engagement. - Added phone/email/booking click tracking that previously didn't exist. - Google Ads conversions fire automatically once an AW- conversion ID + labels are configured (via window.PID_ANALYTICS.googleAds or the ADS defaults); dormant and side-effect-free until then. Contact-form UX fix (surfaced by a live report): - The form showed a generic "Something went wrong" for server-side validation failures because the JS never read the response. It now parses the response and shows the server's specific reason (e.g. message-too-short, rate-limit). - Client-side validation now mirrors the server (name >= 2, message >= 10 chars) so users get actionable feedback before submitting — a 9-char message no longer looks like a server error. Verified in a headless browser. Docs: - docs/pid/marketing/measurement-plan.md — event catalog, GA4 key-event setup, Google Ads conversion import/config, DebugView QA, call-tracking note. - docs/pid/marketing/30-day-campaign-plan.md — objective/positioning, channel mix + budget allocation, weekly cadence tied to the IG calendar, KPIs/targets, launch checklist (incl. the cPanel deploy step), day-30 review. Instagram calendar (unblocked): - The source workbook is committed at docs/pid/marketing/social/. Generated the authoritative automation/instagram/content-calendar.json from it and added Excel-serial→ISO date conversion to parse_calendar.py (dates now real: 2025-08-11 → 2025-09-06). content-calendar.json is now tracked (reproducible from the committed workbook); queue/bundles remain build artifacts. All linters pass (HTMLHint/Stylelint/ESLint); 43/43 PHP unit tests pass; conversion events + form UX verified end-to-end in headless Chromium. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R2zjTE7NTsrMH1FT6iwdc9
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
Phase 3 — analytics & campaign readiness. Turns the site's existing GA4/GTM setup into proper conversion tracking, adds the campaign & measurement docs, fixes a live contact-form UX bug, and generates the authoritative Instagram calendar from the committed workbook.
1. Conversion tracking (
js/pleasure-island-scripts.js)trackConversion()fires semantic GA4 key events:generate_lead(contact),newsletter_signup,request_consultation(booking link),phone_call(tel:) — replacing the ad-hocform_submit. Plusemail_clickengagement.AW-ID + labels are set (window.PID_ANALYTICS.googleAdsor theADSdefaults). Dormant and side-effect-free until configured.phone_call,email_click,request_consultationall fire; no Ads call fires without config.2. 🐛 Contact-form UX fix (from a live report)
A screenshot showed the production form returning a generic "Something went wrong." Root cause: the JS never read the server response, so server-side validation failures (e.g. a message under the 10-char minimum) surfaced as a generic error.
3. Docs
docs/pid/marketing/measurement-plan.md— event catalog, GA4 key-event setup, Google Ads conversion import/config, DebugView QA, call-tracking note.docs/pid/marketing/30-day-campaign-plan.md— objective/positioning, channel mix + budget allocation, weekly cadence tied to the IG calendar, KPIs/targets, launch checklist, day-30 review.4. Instagram calendar (unblocked)
The source workbook is committed at
docs/pid/marketing/social/instagram-30-day-calendar.xlsx, so I generated the authoritativeautomation/instagram/content-calendar.jsonfrom it and added Excel-serial→ISO date conversion toparse_calendar.py(dates now real: 2025-08-11 → 2025-09-06). The calendar is now tracked (reproducible from the committed workbook); queue/bundles stay build artifacts.Testing
Action required
mainto production (the biggest one — the live site is stale).GOOGLE_PLACES_API_KEY+GOOGLE_PLACE_ID.AW-ID/labels per the measurement plan.🤖 Generated with Claude Code
https://claude.ai/code/session_01R2zjTE7NTsrMH1FT6iwdc9
Generated by Claude Code