@stacksjs/defaults 0.75.515 → 0.75.519
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/AGENTS.md +2 -2
- package/ai/skills/stacks-buddy/SKILL.md +1 -1
- package/ai/skills/stacks-build/SKILL.md +10 -0
- package/ai/skills/stacks-chief-of-staff/NOTICE.md +2 -2
- package/ai/skills/stacks-chief-of-staff/PLAYBOOK.md +32 -2
- package/ai/skills/stacks-codebase-design/DESIGN-IT-TWICE.md +1 -2
- package/ai/skills/stacks-codebase-design/NOTICE.md +2 -2
- package/ai/skills/stacks-docs/SKILL.md +78 -80
- package/ai/skills/stacks-domain-modeling/NOTICE.md +2 -2
- package/ai/skills/stacks-flow/ENGINEERING.md +3 -0
- package/ai/skills/stacks-flow/NOTICE.md +2 -2
- package/ai/skills/stacks-flow/upstream-skills.json +121 -90
- package/ai/skills/stacks-git/NOTICE.md +2 -2
- package/ai/skills/stacks-grill-with-docs/NOTICE.md +2 -2
- package/ai/skills/stacks-grilling/NOTICE.md +4 -4
- package/ai/skills/stacks-guard/NOTICE.md +2 -2
- package/ai/skills/stacks-handoff/NOTICE.md +4 -4
- package/ai/skills/stacks-implement/NOTICE.md +2 -2
- package/ai/skills/stacks-implement-spec/NOTICE.md +2 -2
- package/ai/skills/stacks-implement-spec/PLAYBOOK.md +4 -2
- package/ai/skills/stacks-improve-codebase-architecture/NOTICE.md +2 -2
- package/ai/skills/stacks-improve-codebase-architecture/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-investigate/NOTICE.md +2 -2
- package/ai/skills/stacks-loop/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing/CATALOG.md +5 -2
- package/ai/skills/stacks-marketing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-ab-testing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-ab-testing/PLAYBOOK.md +9 -4
- package/ai/skills/stacks-marketing-ab-testing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-ab-testing/references/sample-size-guide.md +42 -27
- package/ai/skills/stacks-marketing-ad-creative/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-ad-creative/PLAYBOOK.md +41 -11
- package/ai/skills/stacks-marketing-ad-creative/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-ad-creative/evals/evals.json +1 -1
- package/ai/skills/stacks-marketing-ad-creative/references/generative-tools.md +47 -51
- package/ai/skills/stacks-marketing-ad-creative/references/hook-system.md +7 -0
- package/ai/skills/stacks-marketing-ad-creative/references/imessage-video-ads.md +2 -2
- package/ai/skills/stacks-marketing-ads/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-ads/PLAYBOOK.md +37 -28
- package/ai/skills/stacks-marketing-ads/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-ads/evals/evals.json +53 -0
- package/ai/skills/stacks-marketing-ads/references/abm-playbook.md +1 -1
- package/ai/skills/stacks-marketing-ads/references/audit-guardrails.md +11 -1
- package/ai/skills/stacks-marketing-ads/references/creative-research-automation.md +19 -0
- package/ai/skills/stacks-marketing-ads/references/google-ads-audit-checklist.md +35 -2
- package/ai/skills/stacks-marketing-ads/references/google-search-playbook.md +4 -0
- package/ai/skills/stacks-marketing-ads/references/linkedin-b2b-playbook.md +2 -0
- package/ai/skills/stacks-marketing-ads/references/meta-andromeda-playbook.md +33 -0
- package/ai/skills/stacks-marketing-ads/references/operating-check.md +75 -0
- package/ai/skills/stacks-marketing-ads/references/reading-google-ads-data.md +1 -1
- package/ai/skills/stacks-marketing-ai-seo/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-ai-seo/PLAYBOOK.md +32 -30
- package/ai/skills/stacks-marketing-ai-seo/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-ai-seo/evals/evals.json +27 -0
- package/ai/skills/stacks-marketing-ai-seo/references/agent-defaults.md +79 -0
- package/ai/skills/stacks-marketing-ai-seo/references/agent-readiness.md +61 -11
- package/ai/skills/stacks-marketing-ai-seo/references/ai-attribution.md +54 -0
- package/ai/skills/stacks-marketing-ai-seo/references/answer-accuracy.md +84 -0
- package/ai/skills/stacks-marketing-ai-seo/references/citations-vs-recommendations.md +32 -1
- package/ai/skills/stacks-marketing-ai-seo/references/content-patterns.md +24 -0
- package/ai/skills/stacks-marketing-ai-seo/references/multilingual-and-commerce.md +55 -0
- package/ai/skills/stacks-marketing-ai-seo/references/platform-ranking-factors.md +31 -11
- package/ai/skills/stacks-marketing-ai-seo/references/prompt-portfolio.md +97 -0
- package/ai/skills/stacks-marketing-analytics/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-analytics/PLAYBOOK.md +74 -15
- package/ai/skills/stacks-marketing-analytics/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-analytics/references/event-library.md +2 -2
- package/ai/skills/stacks-marketing-analytics/references/ga4-implementation.md +3 -3
- package/ai/skills/stacks-marketing-aso/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-aso/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-aso/references/apple-specs.md +1 -1
- package/ai/skills/stacks-marketing-aso/references/scoring-criteria.md +3 -3
- package/ai/skills/stacks-marketing-attribution/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-attribution/PLAYBOOK.md +11 -11
- package/ai/skills/stacks-marketing-attribution/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-attribution/references/by-business-type.md +1 -1
- package/ai/skills/stacks-marketing-attribution/references/measurement-paradigms.md +4 -3
- package/ai/skills/stacks-marketing-churn-prevention/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-churn-prevention/PLAYBOOK.md +14 -4
- package/ai/skills/stacks-marketing-churn-prevention/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-churn-prevention/references/dunning-playbook.md +10 -7
- package/ai/skills/stacks-marketing-co-marketing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-co-marketing/PLAYBOOK.md +4 -4
- package/ai/skills/stacks-marketing-co-marketing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-co-marketing/references/partnership-types.md +2 -2
- package/ai/skills/stacks-marketing-cold-email/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-cold-email/PLAYBOOK.md +6 -6
- package/ai/skills/stacks-marketing-cold-email/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-cold-email/references/deliverability.md +1 -1
- package/ai/skills/stacks-marketing-cold-email/references/follow-up-sequences.md +1 -1
- package/ai/skills/stacks-marketing-cold-email/references/multichannel-cadence.md +1 -1
- package/ai/skills/stacks-marketing-cold-email/references/outbound-plays.md +1 -1
- package/ai/skills/stacks-marketing-cold-email/references/personalization.md +1 -1
- package/ai/skills/stacks-marketing-community-marketing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-community-marketing/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-community-marketing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-community-marketing/references/community-models.md +2 -2
- package/ai/skills/stacks-marketing-competitor-profiling/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-competitor-profiling/PLAYBOOK.md +2 -0
- package/ai/skills/stacks-marketing-competitor-profiling/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-competitors/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-competitors/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-content-strategy/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-content-strategy/PLAYBOOK.md +4 -1
- package/ai/skills/stacks-marketing-content-strategy/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-content-strategy/references/headless-cms.md +3 -3
- package/ai/skills/stacks-marketing-conversion-tracking/LICENSE +21 -0
- package/ai/skills/stacks-marketing-conversion-tracking/NOTICE.md +12 -0
- package/ai/skills/stacks-marketing-conversion-tracking/PLAYBOOK.md +164 -0
- package/ai/skills/stacks-marketing-conversion-tracking/SKILL.md +16 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/README.md +61 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-acuity-scheduling.json +160 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-cal-com.json +141 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-calendly.json +122 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-contact-form-7.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-divi-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-elementor-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-file-download.json +81 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-fluent-forms.json +104 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-formidable-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-forminator.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-framer-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-generic-ajax-form.json +81 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-gravity-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-hubspot-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-jotform.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-ninja-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-phone-click.json +81 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-squarespace-forms.json +122 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-tally.json +122 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-thank-you-page.json +81 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-typeform.json +122 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-webflow-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-wix-forms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-wpforms.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-ws-form.json +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/event-map.json +132 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/ga4.json +58 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/google-ads.json +76 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/linkedin.json +128 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/meta.json +128 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/microsoft.json +128 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/tiktok.json +128 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/README.md +112 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/acuity-scheduling-field.html +28 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/acuity-scheduling.js +75 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/cal-com.js +134 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/calendly.js +113 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/contact-form-7.js +101 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/divi-forms.js +54 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/elementor-forms.js +54 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/file-download.js +96 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/fluent-forms.js +103 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/formidable-forms.js +203 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/forminator.js +65 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/framer-forms.js +96 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/generic-ajax-form.js +165 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/gravity-forms.js +234 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/hubspot-forms.js +162 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/jotform.js +32 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/ninja-forms.js +154 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/phone-click.js +71 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/squarespace-forms.js +428 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/tally.js +167 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/thank-you-page.js +87 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/typeform.js +147 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/webflow-forms.js +57 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/wix-forms.js +232 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/wix-scheduling.js +80 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/wpforms.js +198 -0
- package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/ws-form.js +57 -0
- package/ai/skills/stacks-marketing-conversion-tracking/evals/evals.json +264 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/audit-playbook.md +106 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/browser-side.md +424 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/conversion-moments.md +318 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/discrepancies.md +136 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/ecommerce-platforms.md +71 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/google-ads.md +316 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/meta.md +202 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/other-platforms.md +201 -0
- package/ai/skills/stacks-marketing-conversion-tracking/references/server-side.md +167 -0
- package/ai/skills/stacks-marketing-conversion-tracking/scripts/build-recipe.ts +140 -0
- package/ai/skills/stacks-marketing-copy-editing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-copy-editing/PLAYBOOK.md +3 -1
- package/ai/skills/stacks-marketing-copy-editing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-copy-editing/evals/evals.json +13 -0
- package/ai/skills/stacks-marketing-copy-editing/references/checklist.md +24 -0
- package/ai/skills/stacks-marketing-copywriting/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-copywriting/PLAYBOOK.md +55 -2
- package/ai/skills/stacks-marketing-copywriting/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-copywriting/evals/evals.json +14 -0
- package/ai/skills/stacks-marketing-copywriting/references/ai-tells.md +48 -0
- package/ai/skills/stacks-marketing-copywriting/references/copy-frameworks.md +1 -1
- package/ai/skills/stacks-marketing-council/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-council/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-cro/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-cro/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-cro/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-customer-research/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-customer-research/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-customer-research/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-customer-research/references/source-guides.md +1 -1
- package/ai/skills/stacks-marketing-directory-submissions/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-directory-submissions/PLAYBOOK.md +6 -5
- package/ai/skills/stacks-marketing-directory-submissions/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-directory-submissions/evals/evals.json +14 -2
- package/ai/skills/stacks-marketing-directory-submissions/references/directory-list.md +4 -4
- package/ai/skills/stacks-marketing-directory-submissions/references/positioning-variations.md +1 -1
- package/ai/skills/stacks-marketing-directory-submissions/references/submission-tracker-template.csv +1 -1
- package/ai/skills/stacks-marketing-emails/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-emails/PLAYBOOK.md +9 -7
- package/ai/skills/stacks-marketing-emails/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-events/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-events/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-free-tools/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-free-tools/PLAYBOOK.md +6 -5
- package/ai/skills/stacks-marketing-free-tools/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-free-tools/evals/evals.json +3 -2
- package/ai/skills/stacks-marketing-free-tools/references/tool-benchmarks.md +24 -23
- package/ai/skills/stacks-marketing-ideas/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-ideas/PLAYBOOK.md +1 -0
- package/ai/skills/stacks-marketing-ideas/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-image/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-image/PLAYBOOK.md +6 -6
- package/ai/skills/stacks-marketing-image/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-image/references/ai-image-prompting.md +5 -5
- package/ai/skills/stacks-marketing-influencer-marketing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-influencer-marketing/PLAYBOOK.md +11 -4
- package/ai/skills/stacks-marketing-influencer-marketing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-influencer-marketing/evals/evals.json +14 -0
- package/ai/skills/stacks-marketing-influencer-marketing/references/newsletter-sponsorships.md +76 -0
- package/ai/skills/stacks-marketing-influencer-marketing/references/paid-ads-creator-program.md +79 -0
- package/ai/skills/stacks-marketing-influencer-marketing/references/telegram-channels.md +111 -0
- package/ai/skills/stacks-marketing-launch/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-launch/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-launch/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-launch/references/site-launch-qa.md +2 -2
- package/ai/skills/stacks-marketing-lead-magnets/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-lead-magnets/PLAYBOOK.md +1 -2
- package/ai/skills/stacks-marketing-lead-magnets/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-link-building/LICENSE +21 -0
- package/ai/skills/stacks-marketing-link-building/NOTICE.md +8 -0
- package/ai/skills/stacks-marketing-link-building/PLAYBOOK.md +167 -0
- package/ai/skills/stacks-marketing-link-building/SKILL.md +16 -0
- package/ai/skills/stacks-marketing-link-building/evals/evals.json +71 -0
- package/ai/skills/stacks-marketing-link-building/references/prospecting-and-outreach.md +114 -0
- package/ai/skills/stacks-marketing-link-building/references/risk-policy.md +56 -0
- package/ai/skills/stacks-marketing-link-building/references/tactics.md +106 -0
- package/ai/skills/stacks-marketing-loops/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-loops/PLAYBOOK.md +3 -2
- package/ai/skills/stacks-marketing-loops/SKILL.md +2 -2
- package/ai/skills/stacks-marketing-loops/references/loop-catalog.md +131 -14
- package/ai/skills/stacks-marketing-loops/references/loop-orchestration.md +2 -2
- package/ai/skills/stacks-marketing-loops/references/loop-state.md +21 -0
- package/ai/skills/stacks-marketing-loops/references/seo-operator.md +1 -1
- package/ai/skills/stacks-marketing-offers/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-offers/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-offers/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-offers/evals/evals.json +13 -0
- package/ai/skills/stacks-marketing-offers/references/offer-formats.md +1 -1
- package/ai/skills/stacks-marketing-onboarding/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-onboarding/PLAYBOOK.md +10 -4
- package/ai/skills/stacks-marketing-onboarding/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-onboarding/evals/evals.json +2 -2
- package/ai/skills/stacks-marketing-onboarding/references/activation-models.md +4 -1
- package/ai/skills/stacks-marketing-paywalls/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-paywalls/PLAYBOOK.md +3 -0
- package/ai/skills/stacks-marketing-paywalls/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-paywalls/evals/evals.json +15 -0
- package/ai/skills/stacks-marketing-paywalls/references/experiments.md +7 -3
- package/ai/skills/stacks-marketing-paywalls/references/mobile-subscription-paywalls.md +69 -0
- package/ai/skills/stacks-marketing-plan/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-plan/PLAYBOOK.md +5 -0
- package/ai/skills/stacks-marketing-plan/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-popups/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-popups/PLAYBOOK.md +1 -2
- package/ai/skills/stacks-marketing-popups/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-pricing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-pricing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-pricing/references/research-methods.md +12 -2
- package/ai/skills/stacks-marketing-product-marketing/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-product-marketing/PLAYBOOK.md +72 -7
- package/ai/skills/stacks-marketing-product-marketing/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-product-marketing/references/brand-voice.md +103 -0
- package/ai/skills/stacks-marketing-programmatic-seo/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-programmatic-seo/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-programmatic-seo/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-programmatic-seo/references/implementation-platforms.md +2 -2
- package/ai/skills/stacks-marketing-programmatic-seo/references/playbooks.md +1 -1
- package/ai/skills/stacks-marketing-prospecting/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-prospecting/PLAYBOOK.md +18 -18
- package/ai/skills/stacks-marketing-prospecting/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-prospecting/evals/evals.json +28 -0
- package/ai/skills/stacks-marketing-prospecting/references/data-sources.md +12 -12
- package/ai/skills/stacks-marketing-prospecting/references/enrichment-playbook.md +1 -1
- package/ai/skills/stacks-marketing-prospecting/references/signal-plays.md +44 -2
- package/ai/skills/stacks-marketing-psychology/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-psychology/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-public-relations/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-public-relations/PLAYBOOK.md +3 -0
- package/ai/skills/stacks-marketing-public-relations/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-referrals/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-referrals/PLAYBOOK.md +8 -8
- package/ai/skills/stacks-marketing-referrals/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-referrals/references/affiliate-programs.md +1 -1
- package/ai/skills/stacks-marketing-referrals/references/program-examples.md +9 -2
- package/ai/skills/stacks-marketing-referrals/references/review-programs.md +1 -1
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/LICENSE +21 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/NOTICE.md +8 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/PLAYBOOK.md +312 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/SKILL.md +21 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/evals/evals.json +242 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/content-teardown.md +97 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/data-sources.md +147 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/funnel-hack.md +96 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/go-inside.md +107 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/hidden-signals.md +78 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/agencies-b2b-services.md +84 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/automotive.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/care-services.md +83 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/consumer-hardware.md +87 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/cpg-food-beverage.md +85 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/crypto-web3.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/ecommerce-dtc.md +93 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/education.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/events-entertainment.md +88 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/finance.md +92 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/fitness-wellness.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/franchising.md +84 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/gambling-betting.md +85 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/games-pc-console.md +84 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/govtech-public-sector.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/healthcare.md +88 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/hospitality-travel.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/insurance.md +87 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/legal-professional-services.md +86 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/local-services.md +88 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/logistics-transportation.md +87 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/manufacturing-industrial.md +84 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/marketplaces.md +85 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/media-creators.md +85 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/mobile-apps-games.md +96 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/nonprofit.md +84 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/real-estate.md +87 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/regulated-goods.md +88 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/retail.md +88 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/saas.md +91 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/solar-home-energy.md +84 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/landscape.md +85 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/play-routing.md +73 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/playbook-template.md +133 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/team-voices.md +71 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/timeline-analysis.md +62 -0
- package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/weak-spots.md +70 -0
- package/ai/skills/stacks-marketing-revops/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-revops/PLAYBOOK.md +14 -14
- package/ai/skills/stacks-marketing-revops/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-revops/references/automation-playbooks.md +3 -3
- package/ai/skills/stacks-marketing-revops/references/inbound-routing.md +1 -1
- package/ai/skills/stacks-marketing-revops/references/lifecycle-definitions.md +2 -0
- package/ai/skills/stacks-marketing-revops/references/scoring-models.md +14 -13
- package/ai/skills/stacks-marketing-sales-enablement/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-sales-enablement/PLAYBOOK.md +2 -2
- package/ai/skills/stacks-marketing-sales-enablement/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-sales-enablement/references/cold-call-scripts.md +1 -1
- package/ai/skills/stacks-marketing-schema/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-schema/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-seo-audit/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-seo-audit/PLAYBOOK.md +5 -4
- package/ai/skills/stacks-marketing-seo-audit/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-seo-audit/references/international-seo.md +3 -1
- package/ai/skills/stacks-marketing-seo-audit/references/rankings-push.md +1 -1
- package/ai/skills/stacks-marketing-signup/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-signup/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-marketing-signup/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-site-architecture/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-site-architecture/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-site-architecture/references/platforms-and-migration.md +1 -1
- package/ai/skills/stacks-marketing-sms/NOTICE.md +1 -1
- package/ai/skills/stacks-marketing-sms/PLAYBOOK.md +9 -9
- package/ai/skills/stacks-marketing-sms/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-social/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-social/PLAYBOOK.md +5 -4
- package/ai/skills/stacks-marketing-social/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-social/references/listening.md +13 -0
- package/ai/skills/stacks-marketing-social/references/platforms.md +37 -1
- package/ai/skills/stacks-marketing-social/references/short-form-video.md +51 -6
- package/ai/skills/stacks-marketing-video/NOTICE.md +2 -2
- package/ai/skills/stacks-marketing-video/PLAYBOOK.md +35 -18
- package/ai/skills/stacks-marketing-video/SKILL.md +1 -1
- package/ai/skills/stacks-marketing-video/evals/evals.json +27 -0
- package/ai/skills/stacks-marketing-video/references/code-rendered-product-films.md +119 -0
- package/ai/skills/stacks-native/CATALOG.md +6 -6
- package/ai/skills/stacks-pr/NOTICE.md +2 -2
- package/ai/skills/stacks-prototype/NOTICE.md +2 -2
- package/ai/skills/stacks-research/NOTICE.md +2 -2
- package/ai/skills/stacks-research/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-retro/NOTICE.md +2 -2
- package/ai/skills/stacks-review/NOTICE.md +2 -2
- package/ai/skills/stacks-scaffold-exercises/NOTICE.md +2 -2
- package/ai/skills/stacks-setup-deep-modules/NOTICE.md +2 -2
- package/ai/skills/stacks-setup-engineering/NOTICE.md +2 -2
- package/ai/skills/stacks-setup-engineering/PLAYBOOK.md +3 -1
- package/ai/skills/stacks-setup-engineering/issue-tracker-github.md +8 -4
- package/ai/skills/stacks-setup-engineering/issue-tracker-gitlab.md +3 -3
- package/ai/skills/stacks-software-factory/EXAMPLE-TASKS.md +80 -0
- package/ai/skills/stacks-software-factory/GIT-HOSTS.md +84 -0
- package/ai/skills/stacks-software-factory/LICENSE +21 -0
- package/ai/skills/stacks-software-factory/NOTICE.md +8 -0
- package/ai/skills/stacks-software-factory/OBSERVABILITY-PLATFORMS.md +75 -0
- package/ai/skills/stacks-software-factory/PLAYBOOK.md +95 -0
- package/ai/skills/stacks-software-factory/RUNNERS.md +94 -0
- package/ai/skills/stacks-software-factory/SKILL.md +21 -0
- package/ai/skills/stacks-software-factory/TICKET-TRACKERS.md +85 -0
- package/ai/skills/stacks-tdd/NOTICE.md +2 -2
- package/ai/skills/stacks-teach/NOTICE.md +2 -2
- package/ai/skills/stacks-test-fixtures/NOTICE.md +2 -2
- package/ai/skills/stacks-to-questionnaire/NOTICE.md +2 -2
- package/ai/skills/stacks-to-spec/NOTICE.md +2 -2
- package/ai/skills/stacks-to-tickets/NOTICE.md +2 -2
- package/ai/skills/stacks-triage/NOTICE.md +2 -2
- package/ai/skills/stacks-wait-what/NOTICE.md +2 -2
- package/ai/skills/stacks-wayfinder/NOTICE.md +2 -2
- package/ai/skills/stacks-wayfinder/PLAYBOOK.md +1 -1
- package/ai/skills/stacks-wizard/NOTICE.md +2 -2
- package/ai/skills/stacks-writing-beats/NOTICE.md +2 -2
- package/ai/skills/stacks-writing-for-agents/NOTICE.md +2 -2
- package/ai/skills/stacks-writing-for-agents/SKILL.md +1 -1
- package/ai/skills/stacks-writing-fragments/NOTICE.md +2 -2
- package/ai/skills/stacks-writing-shape/NOTICE.md +2 -2
- package/app/Actions/UnsubscribeAction.ts +1 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
|
|
2
|
+
/* eslint-disable prefer-const, pickier/no-unused-vars */
|
|
3
|
+
/*! Gravity Forms conversion detection (MIT)
|
|
4
|
+
* Detects: form submission. Pushes dataLayer event: gravity_form_submitted
|
|
5
|
+
* From the conversion-tracking skill in Marketing Skills */
|
|
6
|
+
/* Gravity Forms Submission Listener.
|
|
7
|
+
* Event-only adaptation of verified production detection helpers.
|
|
8
|
+
* Source SHA256 3ed591d48dc449e94fd48f634bb07ae8285f5d661a4b48fc5db867ca3e659b69.
|
|
9
|
+
* Reads no form field values. Sends only event and form_id to dataLayer.
|
|
10
|
+
* Native handoff stores only form ID, source path and time in sessionStorage.
|
|
11
|
+
*/
|
|
12
|
+
(function(){
|
|
13
|
+
"use strict";
|
|
14
|
+
if(window.__ctGalleryGravityForms)return;
|
|
15
|
+
window.__ctGalleryGravityForms=true;
|
|
16
|
+
// Preserve the original recipe guard for an old recipe loaded after this code.
|
|
17
|
+
// Do not return on the legacy guard: an old-first listener is independently
|
|
18
|
+
// active and remains an unsupported migration state, but must not suppress us.
|
|
19
|
+
window.__ctDetectGravityForms=true;
|
|
20
|
+
function isGravityForm(formEl) {
|
|
21
|
+
if (!formEl) return false;
|
|
22
|
+
// Check for gform_wrapper parent or gform_ ID prefix
|
|
23
|
+
try {
|
|
24
|
+
if (formEl.closest && formEl.closest('.gform_wrapper')) return true;
|
|
25
|
+
} catch (e) {
|
|
26
|
+
// .closest not available — fall back to ID check
|
|
27
|
+
}
|
|
28
|
+
// Fallback: GF forms have IDs like "gform_1", "gform_5"
|
|
29
|
+
var id = formEl.id || '';
|
|
30
|
+
return /^gform_\d+$/.test(id);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getFormId(formEl) {
|
|
34
|
+
if (!formEl) return null;
|
|
35
|
+
var fid = (formEl.getAttribute && formEl.getAttribute('data-formid')) || '';
|
|
36
|
+
if (fid) return String(fid);
|
|
37
|
+
var id = formEl.id || '';
|
|
38
|
+
var m = /gform_(\d+)/.exec(id);
|
|
39
|
+
return m ? m[1] : null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isAjaxForm(formEl) {
|
|
43
|
+
if (!formEl) return false;
|
|
44
|
+
try {
|
|
45
|
+
var target = (formEl.getAttribute && formEl.getAttribute('target')) || '';
|
|
46
|
+
if (target.indexOf('gform_ajax_frame_') === 0) return true;
|
|
47
|
+
if (formEl.querySelector && formEl.querySelector('input[name="gform_ajax"]')) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
} catch (e) {
|
|
51
|
+
// DOM access failed — treat as non-AJAX; the reload path is the
|
|
52
|
+
// safer default (it still only fires on confirmed success).
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function isNodeHidden(el) {
|
|
58
|
+
try {
|
|
59
|
+
if (el.hidden) return true;
|
|
60
|
+
if (el.getAttribute && el.getAttribute('aria-hidden') === 'true') return true;
|
|
61
|
+
var view = el.ownerDocument && el.ownerDocument.defaultView;
|
|
62
|
+
if (view && view.getComputedStyle) {
|
|
63
|
+
var cs = view.getComputedStyle(el);
|
|
64
|
+
if (cs && (cs.display === 'none' || cs.visibility === 'hidden')) return true;
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
// fall through
|
|
68
|
+
}
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function hasVisibleValidationErrors(rootEl) {
|
|
73
|
+
if (!rootEl || !rootEl.querySelectorAll) return false;
|
|
74
|
+
try {
|
|
75
|
+
if (rootEl.className &&
|
|
76
|
+
(' ' + rootEl.className + ' ').indexOf(' gform_validation_error ') !== -1) {
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
var nodes = rootEl.querySelectorAll(
|
|
80
|
+
'.gform_validation_errors, .validation_error, .gfield_error, .validation_message, [aria-invalid="true"]'
|
|
81
|
+
);
|
|
82
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
83
|
+
var node = nodes[i];
|
|
84
|
+
if (isNodeHidden(node)) continue;
|
|
85
|
+
if (node.getAttribute && node.getAttribute('aria-invalid') === 'true') return true;
|
|
86
|
+
// Error classes and ARIA state are structural signals. Never read
|
|
87
|
+
// rendered validation text: themes may include resolved field values.
|
|
88
|
+
var classes = typeof node.className === 'string' ? node.className : '';
|
|
89
|
+
if (/^(?:.*\s)?(?:gform_validation_errors|validation_error|gfield_error)(?:\s.*)?$/.test(classes)) return true;
|
|
90
|
+
}
|
|
91
|
+
} catch (e) {
|
|
92
|
+
// fall through
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function safeFormId(formId) {
|
|
98
|
+
if (formId == null) return null;
|
|
99
|
+
var s = String(formId);
|
|
100
|
+
return /^\d+$/.test(s) ? s : null;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function hasServerRejectionMarkers(formId) {
|
|
104
|
+
var fid = safeFormId(formId);
|
|
105
|
+
try {
|
|
106
|
+
if (fid) {
|
|
107
|
+
var scope = document.querySelector('#gform_wrapper_' + fid) ||
|
|
108
|
+
document.querySelector('#gform_' + fid + ', form[data-formid="' + fid + '"]');
|
|
109
|
+
if (scope && scope.closest) {
|
|
110
|
+
scope = scope.closest('.gform_wrapper') || scope;
|
|
111
|
+
}
|
|
112
|
+
// The submitted form isn't on this page at all → no rejection
|
|
113
|
+
// evidence FOR THIS FORM, whatever other forms are showing.
|
|
114
|
+
return scope ? hasVisibleValidationErrors(scope) : false;
|
|
115
|
+
}
|
|
116
|
+
var wrappers = document.querySelectorAll('.gform_wrapper');
|
|
117
|
+
for (var i = 0; i < wrappers.length; i++) {
|
|
118
|
+
if (hasVisibleValidationErrors(wrappers[i])) return true;
|
|
119
|
+
}
|
|
120
|
+
} catch (e) {
|
|
121
|
+
// fall through
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function hasConfirmationMessage(formId) {
|
|
127
|
+
var fid = safeFormId(formId);
|
|
128
|
+
try {
|
|
129
|
+
var nodes = document.querySelectorAll(
|
|
130
|
+
'.gform_confirmation_message, [id^="gform_confirmation_message_"], [id^="gform_confirmation_wrapper_"]'
|
|
131
|
+
);
|
|
132
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
133
|
+
var node = nodes[i];
|
|
134
|
+
if (isNodeHidden(node)) continue;
|
|
135
|
+
// Presence of a visible, form-attributed confirmation element is a
|
|
136
|
+
// structural legacy signal; its rendered contents are never inspected.
|
|
137
|
+
if (!fid) continue;
|
|
138
|
+
// Attribute the node to a form id if it carries one (own id or an
|
|
139
|
+
// ancestor confirmation-wrapper id).
|
|
140
|
+
var taggedId = null;
|
|
141
|
+
var m = /gform_confirmation_(?:message|wrapper)_(\d+)/.exec(node.id || '');
|
|
142
|
+
if (m) {
|
|
143
|
+
taggedId = m[1];
|
|
144
|
+
} else if (node.closest) {
|
|
145
|
+
try {
|
|
146
|
+
var anc = node.closest('[id^="gform_confirmation_wrapper_"], [id^="gform_confirmation_message_"]');
|
|
147
|
+
var am = anc && /_(\d+)$/.exec(anc.id || '');
|
|
148
|
+
if (am) taggedId = am[1];
|
|
149
|
+
} catch (e2) {
|
|
150
|
+
// .closest unavailable — treat as untagged
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (taggedId === fid) return true;
|
|
154
|
+
}
|
|
155
|
+
} catch (e) {
|
|
156
|
+
// fall through
|
|
157
|
+
}
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
var pending={},complete={},TTL=120000,markerKey='__ct_gallery_gf_pending_v3';
|
|
161
|
+
var modernHookInstalled=false,seenEntries={};
|
|
162
|
+
window.dataLayer=window.dataLayer||[];
|
|
163
|
+
function forget(id){var entry=pending[id];if(entry&&entry.timer)clearTimeout(entry.timer);delete pending[id];}
|
|
164
|
+
function discardNotice(id,reason,form){try{document.dispatchEvent(new CustomEvent('ct:gform-attempt-discarded',{detail:{formId:String(id||''),reason:reason||'discarded',form:form||null}}));}catch(e){}}
|
|
165
|
+
function emitConfirmed(id,form,uniqueAccepted){id=safeFormId(id);if(!id||(!uniqueAccepted&&complete[id]))return;complete[id]=true;var handled=false;try{if(typeof window.__ctGravityMethod2Emit==='function')handled=window.__ctGravityMethod2Emit(id,form)===true;}catch(e){}if(!handled)window.dataLayer.push({event:'gravity_form_submitted',form_id:id});}
|
|
166
|
+
function fireLegacy(id){id=safeFormId(id);if(modernHookInstalled||!id||!pending[id]||complete[id])return;var form=pending[id].form;forget(id);emitConfirmed(id,form);}
|
|
167
|
+
function attempt(form,method,type){
|
|
168
|
+
if(!isGravityForm(form))return;var id=safeFormId(getFormId(form));if(!id)return;
|
|
169
|
+
if(modernHookInstalled){return;}
|
|
170
|
+
if(type&&type!=='submit'){forget(id);discardNotice(id,'nonfinal');return;}
|
|
171
|
+
forget(id);complete[id]=false;
|
|
172
|
+
var entry={form:form,method:method||(isAjaxForm(form)?'iframe':'postback'),trusted:method==='postback',time:Date.now(),path:location.pathname,timer:null};
|
|
173
|
+
entry.timer=setTimeout(function(){if(pending[id]===entry){forget(id);discardNotice(id,'timeout');}},TTL);pending[id]=entry;
|
|
174
|
+
}
|
|
175
|
+
function acceptedIframe(frame){
|
|
176
|
+
if(modernHookInstalled||!frame||frame.tagName!=='IFRAME'||!/^gform_ajax_frame_\d+$/.test(frame.id||''))return;
|
|
177
|
+
var id=frame.id.replace('gform_ajax_frame_','');if(!pending[id])return;
|
|
178
|
+
try{var doc=frame.contentDocument;if(!doc||!doc.querySelector('.GF_AJAX_POSTBACK'))return;if(doc.querySelector('.gform_validation_error, .gform_validation_errors, .gfield_error, [aria-invalid=\"true\"]')){forget(id);discardNotice(id,'rejected');return;}var confirmation=doc.querySelector('#gform_confirmation_wrapper_'+id+', #gform_confirmation_message_'+id);if(confirmation&&!isNodeHidden(confirmation))fireLegacy(id);}catch(e){}
|
|
179
|
+
}
|
|
180
|
+
document.addEventListener('load',function(event){acceptedIframe(event.target);},true);
|
|
181
|
+
var jqueryHooked=false;
|
|
182
|
+
function hook(){
|
|
183
|
+
if(!jqueryHooked&&typeof window.jQuery==='function'){jqueryHooked=true;window.jQuery(document).on('gform_confirmation_loaded.ctGallery',function(event,id){fireLegacy(id);});}
|
|
184
|
+
if(modernHookInstalled||!window.gform||!gform.utils||!gform.utils.addAsyncFilter)return;
|
|
185
|
+
modernHookInstalled=true;
|
|
186
|
+
gform.utils.addAsyncFilter('gform/submission/pre_submission',function(data){
|
|
187
|
+
var form=data&&data.form;if(form&&!form.tagName&&form[0])form=form[0];var id=safeFormId(getFormId(form));
|
|
188
|
+
if(!id)return data;
|
|
189
|
+
if(data.submissionType!=='submit'){
|
|
190
|
+
discardNotice(id,'nonfinal',form);
|
|
191
|
+
return data;
|
|
192
|
+
}
|
|
193
|
+
if(data.abort===true)return data;
|
|
194
|
+
if(data.submissionMethod==='postback'||data.submissionMethod==='iframe')data.submissionMethod='ajax';
|
|
195
|
+
return data;
|
|
196
|
+
});
|
|
197
|
+
gform.utils.addAsyncFilter('gform/submission/submission_started',function(data){
|
|
198
|
+
var form=data&&data.form;if(form&&!form.tagName&&form[0])form=form[0];var id=safeFormId(getFormId(form));
|
|
199
|
+
if(id&&data.submissionType==='submit')complete[id]=false;
|
|
200
|
+
return data;
|
|
201
|
+
});
|
|
202
|
+
gform.utils.addAsyncFilter('gform/ajax/post_ajax_submission',function(data){
|
|
203
|
+
var form=data&&data.form;if(form&&!form.tagName&&form[0])form=form[0];var id=safeFormId(getFormId(form));if(!id)return data;
|
|
204
|
+
var result=data&&data.submissionResult,verdict=result&&result.data;
|
|
205
|
+
var rawEntryId=verdict&&verdict.entry_id,entryId=typeof rawEntryId==='number'?rawEntryId:(typeof rawEntryId==='string'&&/^\d+$/.test(rawEntryId)?Number(rawEntryId):NaN);
|
|
206
|
+
var key=id+':'+entryId;
|
|
207
|
+
if(result&&result.success===true&&verdict&&verdict.is_valid===true&&verdict.submission_type==='submit'&&isFinite(entryId)&&Math.floor(entryId)===entryId&&entryId>0&&entryId<=9007199254740991&&verdict.is_spam===false){
|
|
208
|
+
if(seenEntries[key]){discardNotice(id,'duplicate-entry',form);return data;}
|
|
209
|
+
seenEntries[key]=true;emitConfirmed(id,form,true);
|
|
210
|
+
}else if(result&&result.success===true)discardNotice(id,'rejected',form);
|
|
211
|
+
return data;
|
|
212
|
+
});
|
|
213
|
+
gform.utils.addAsyncFilter('gform/ajax/pre_display_error',function(data){
|
|
214
|
+
if(data&&data.formId){var errorForm=null;try{errorForm=document.querySelector('#gform_'+safeFormId(data.formId));}catch(e){}discardNotice(data.formId,'ajax-error',errorForm);}
|
|
215
|
+
return data;
|
|
216
|
+
});
|
|
217
|
+
document.addEventListener('gform/submission/submission_aborted',function(event){
|
|
218
|
+
var form=event&&event.detail&&event.detail.form,id=safeFormId(getFormId(form));
|
|
219
|
+
if(id)discardNotice(id,'abort',form);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
hook();document.addEventListener('gform/theme/scripts_loaded',hook);document.addEventListener('DOMContentLoaded',hook);window.addEventListener('load',hook);
|
|
223
|
+
document.addEventListener('submit',function(event){attempt(event.target,null,'submit');},true);
|
|
224
|
+
document.addEventListener('click',function(event){var el=event.target;if(!el||!el.closest)return;var control=el.closest('[id^="gform_submit_button_"]');if(control)attempt(control.closest('form'),null,'submit');},true);
|
|
225
|
+
function confirmationNode(node){if(modernHookInstalled||!node||node.nodeType!==1)return;var nodes=[];if(node.matches&&node.matches('[id^="gform_confirmation_message_"], [id^="gform_confirmation_wrapper_"]'))nodes.push(node);if(node.querySelectorAll){var list=node.querySelectorAll('[id^="gform_confirmation_message_"], [id^="gform_confirmation_wrapper_"]');for(var i=0;i<list.length;i++)nodes.push(list[i]);}for(var j=0;j<nodes.length;j++){var match=/gform_confirmation_(?:message|wrapper)_(\d+)/.exec(nodes[j].id||'');if(match&&!isNodeHidden(nodes[j]))fireLegacy(match[1]);}}
|
|
226
|
+
if(typeof MutationObserver==='function')new MutationObserver(function(mutations){for(var i=0;i<mutations.length;i++)for(var j=0;j<mutations[i].addedNodes.length;j++)confirmationNode(mutations[i].addedNodes[j]);}).observe(document.body||document.documentElement,{childList:true,subtree:true});
|
|
227
|
+
window.addEventListener('pagehide',function(){
|
|
228
|
+
var markers=[];for(var id2 in pending)if(Object.prototype.hasOwnProperty.call(pending,id2)){var entry=pending[id2];if(entry.method!=='postback'||Date.now()-entry.time>10000||(!entry.trusted&&hasVisibleValidationErrors(entry.form)))continue;markers.push({id:id2,time:entry.time,path:entry.path});}
|
|
229
|
+
if(markers.length)try{sessionStorage.setItem(markerKey,JSON.stringify(markers));}catch(e){}
|
|
230
|
+
});
|
|
231
|
+
function deferred(){if(modernHookInstalled)return;var markers;try{var raw=sessionStorage.getItem(markerKey);sessionStorage.removeItem(markerKey);markers=JSON.parse(raw||'[]');}catch(e){return;}if(!Array.isArray(markers))return;for(var i=0;i<markers.length;i++){var marker=markers[i],id=safeFormId(marker&&marker.id);if(!id||!marker.time||Date.now()-marker.time>60000)continue;if(hasServerRejectionMarkers(id))continue;if(hasConfirmationMessage(id)){pending[id]={};fireLegacy(id);}}}
|
|
232
|
+
if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',deferred);else deferred();
|
|
233
|
+
|
|
234
|
+
})();
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
// Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
|
|
2
|
+
/* eslint-disable prefer-const, pickier/no-unused-vars */
|
|
3
|
+
/*! HubSpot Forms conversion detection (MIT)
|
|
4
|
+
* Detects: form submission. Pushes dataLayer event: hubspot_form_submitted
|
|
5
|
+
* From the conversion-tracking skill in Marketing Skills */
|
|
6
|
+
(function () {
|
|
7
|
+
if (window.__ctDetectHubspotForms) return;
|
|
8
|
+
window.__ctDetectHubspotForms = true;
|
|
9
|
+
window.dataLayer = window.dataLayer || [];
|
|
10
|
+
|
|
11
|
+
// Updated-editor conversions are keyed by HubSpot's documented conversion
|
|
12
|
+
// ID. Legacy messages use event-object identity because their documented
|
|
13
|
+
// callback payload has no conversion ID.
|
|
14
|
+
var seenConversions = {};
|
|
15
|
+
var seenLegacyEvents = typeof WeakSet === 'function' ? new WeakSet() : [];
|
|
16
|
+
|
|
17
|
+
function fireConversion(formId, conversionId, acceptedContext) {
|
|
18
|
+
var id = formId ? String(formId) : '';
|
|
19
|
+
if (typeof conversionId !== 'string' || !conversionId) return false;
|
|
20
|
+
var key = '$' + conversionId;
|
|
21
|
+
if (seenConversions[key]) return false;
|
|
22
|
+
seenConversions[key] = true;
|
|
23
|
+
var handled = false;
|
|
24
|
+
var adapter = window.__ctHubspotMethod2Handler;
|
|
25
|
+
if (typeof adapter === 'function') {
|
|
26
|
+
try {
|
|
27
|
+
handled = adapter({
|
|
28
|
+
formId: id,
|
|
29
|
+
instanceId: acceptedContext && acceptedContext.instanceId || '',
|
|
30
|
+
conversionId: conversionId,
|
|
31
|
+
form: acceptedContext && acceptedContext.form || null
|
|
32
|
+
}) === true;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
handled = false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
// The push is contained, and a conversion whose push failed is
|
|
38
|
+
// forgotten, so a repeat of HubSpot's event can still count it.
|
|
39
|
+
if (!handled) {
|
|
40
|
+
try {
|
|
41
|
+
window.dataLayer = window.dataLayer || [];
|
|
42
|
+
window.dataLayer.push({ event: 'hubspot_form_submitted', form_id: id });
|
|
43
|
+
} catch (e) {
|
|
44
|
+
delete seenConversions[key];
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function claimLegacyEvent(event) {
|
|
52
|
+
if (!event || typeof event !== 'object') return false;
|
|
53
|
+
if (seenLegacyEvents && typeof seenLegacyEvents.has === 'function') {
|
|
54
|
+
if (seenLegacyEvents.has(event)) return false;
|
|
55
|
+
seenLegacyEvents.add(event);
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (seenLegacyEvents.indexOf(event) !== -1) return false;
|
|
59
|
+
seenLegacyEvents.push(event);
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function releaseLegacyEvent(event) {
|
|
64
|
+
try {
|
|
65
|
+
if (typeof seenLegacyEvents.delete === 'function') { seenLegacyEvents.delete(event); return; }
|
|
66
|
+
var i = seenLegacyEvents.indexOf(event);
|
|
67
|
+
if (i !== -1) seenLegacyEvents.splice(i, 1);
|
|
68
|
+
} catch (e) {}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ------------------------------------------------------------
|
|
72
|
+
// Path 1: current forms editor (live-verified)
|
|
73
|
+
// ------------------------------------------------------------
|
|
74
|
+
// HubSpot dispatches this on the .hs-form-frame container and lets it bubble
|
|
75
|
+
// (or on document itself when it cannot find the container), with
|
|
76
|
+
// detail = { formId, instanceId }. It only ever follows a submission
|
|
77
|
+
// HubSpot's server accepted. Listening on document in the capture phase
|
|
78
|
+
// catches both dispatch points and cannot be silenced by page code that
|
|
79
|
+
// stops the event's propagation further down.
|
|
80
|
+
function hubspotFormsApi() {
|
|
81
|
+
return window.HubSpotFormsV4 || window.HubspotFormsV4 || null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function handleSubmissionSuccess(event) {
|
|
85
|
+
try {
|
|
86
|
+
var detail = event && event.detail;
|
|
87
|
+
if (!detail || typeof detail.formId !== 'string' || !detail.formId) return;
|
|
88
|
+
if (typeof detail.instanceId !== 'string' || !detail.instanceId) return;
|
|
89
|
+
// When HubSpot's forms API is on the page, the event must name a form
|
|
90
|
+
// instance HubSpot actually rendered here. A stray or malformed event
|
|
91
|
+
// with a made-up instance id is ignored.
|
|
92
|
+
var api = hubspotFormsApi();
|
|
93
|
+
if (!api || typeof api.getFormFromEvent !== 'function') return;
|
|
94
|
+
var form = api.getFormFromEvent(event);
|
|
95
|
+
if (!form || typeof form.getFormId !== 'function' ||
|
|
96
|
+
typeof form.getInstanceId !== 'function' ||
|
|
97
|
+
typeof form.getConversionId !== 'function') return;
|
|
98
|
+
if (form.getFormId() !== detail.formId ||
|
|
99
|
+
form.getInstanceId() !== detail.instanceId) return;
|
|
100
|
+
// HubSpot documents getConversionId as valid after successful
|
|
101
|
+
// submission. It is the stable key for event replay and repeated submits.
|
|
102
|
+
fireConversion(detail.formId, form.getConversionId(), { form: form, instanceId: detail.instanceId });
|
|
103
|
+
} catch (e) {
|
|
104
|
+
// Never throw back into HubSpot's own event dispatch.
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ------------------------------------------------------------
|
|
109
|
+
// Path 2: legacy forms editor (ported from the production module)
|
|
110
|
+
// ------------------------------------------------------------
|
|
111
|
+
// Legacy forms announce each lifecycle step with a postMessage of
|
|
112
|
+
// { type: 'hsFormCallback', eventName, id, data }. Only 'onFormSubmitted'
|
|
113
|
+
// means the submission was accepted; 'onFormSubmit' also fires for
|
|
114
|
+
// submissions that then fail validation, so it is ignored.
|
|
115
|
+
//
|
|
116
|
+
// The legacy callback payload documents its form ID but not a safe mapping
|
|
117
|
+
// from a cross-origin source WindowProxy to that ID. Accept only the inline
|
|
118
|
+
// same-window callback; cross-origin iframe messages fail closed until a
|
|
119
|
+
// vendor-supported source/form binding can be verified.
|
|
120
|
+
function isTrustedOrigin(event) {
|
|
121
|
+
return !!(event && event.source === window &&
|
|
122
|
+
event.origin === window.location.origin);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function handleMessage(event) {
|
|
126
|
+
try {
|
|
127
|
+
// Reject an unbound source before even reading its structured-clone data.
|
|
128
|
+
if (!isTrustedOrigin(event)) return;
|
|
129
|
+
var data = event && event.data;
|
|
130
|
+
if (!data || typeof data !== 'object') return;
|
|
131
|
+
if (data.type !== 'hsFormCallback') return;
|
|
132
|
+
if (data.eventName !== 'onFormSubmitted') return;
|
|
133
|
+
var formId = data.id;
|
|
134
|
+
if (typeof formId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(formId)) return;
|
|
135
|
+
if (!claimLegacyEvent(event)) return;
|
|
136
|
+
// The documented legacy callback runs after persistence, but has no
|
|
137
|
+
// stable conversion ID. The local guard only recognizes replay of this
|
|
138
|
+
// exact MessageEvent object; a distinct event object may be a replay or a
|
|
139
|
+
// new conversion, so cross-event deduplication is not claimed.
|
|
140
|
+
var handled = false;
|
|
141
|
+
var adapter = window.__ctHubspotMethod2Handler;
|
|
142
|
+
if (typeof adapter === 'function') {
|
|
143
|
+
try {
|
|
144
|
+
handled = adapter({ formId: formId, legacyEvent: event }) === true;
|
|
145
|
+
} catch (e) { handled = false; }
|
|
146
|
+
}
|
|
147
|
+
if (!handled) {
|
|
148
|
+
try {
|
|
149
|
+
window.dataLayer = window.dataLayer || [];
|
|
150
|
+
window.dataLayer.push({ event: 'hubspot_form_submitted', form_id: formId });
|
|
151
|
+
} catch (e) {
|
|
152
|
+
releaseLegacyEvent(event);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} catch (e) {
|
|
156
|
+
// Never throw back into the page's own message handling.
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
document.addEventListener('hs-form-event:on-submission:success', handleSubmissionSuccess, true);
|
|
161
|
+
window.addEventListener('message', handleMessage, false);
|
|
162
|
+
})();
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
|
|
2
|
+
/* eslint-disable prefer-const, pickier/no-unused-vars */
|
|
3
|
+
/*! Jotform conversion detection (MIT)
|
|
4
|
+
* Detects: form submission. Pushes dataLayer event: jotform_form_submitted
|
|
5
|
+
* From the conversion-tracking skill in Marketing Skills */
|
|
6
|
+
/* Jotform iframe completion listener. Reads no form answers.
|
|
7
|
+
* Counts once per embedded frame on this page. */
|
|
8
|
+
(function () {
|
|
9
|
+
'use strict';
|
|
10
|
+
if (window.__ctDetectJotform || window.__ctJotformMethod2Installed) return;
|
|
11
|
+
window.__ctDetectJotform = true;
|
|
12
|
+
window.__ctJotformMethod2Installed = true;
|
|
13
|
+
var completed = [];
|
|
14
|
+
window.addEventListener('message', function (event) {
|
|
15
|
+
if (!event.source || event.source === window) return;
|
|
16
|
+
if (!/^https:\/\/(form|submit)\.jotform\.com$/.test(event.origin)) return;
|
|
17
|
+
var data = event.data;
|
|
18
|
+
if (!data || typeof data !== 'object' || Array.isArray(data) || data.action !== 'submission-completed') return;
|
|
19
|
+
var frames = document.querySelectorAll('iframe');
|
|
20
|
+
for (var i = 0; i < frames.length; i++) {
|
|
21
|
+
var frame = frames[i];
|
|
22
|
+
if (frame.contentWindow !== event.source) continue;
|
|
23
|
+
var match = /^https:\/\/form\.jotform\.com\/(\d+)(?:[/?#]|$)/.exec(frame.getAttribute('src') || '');
|
|
24
|
+
if (!match || (data.formID != null && String(data.formID) !== match[1])) return;
|
|
25
|
+
if (completed.indexOf(frame) !== -1) return;
|
|
26
|
+
completed.push(frame);
|
|
27
|
+
window.dataLayer = window.dataLayer || [];
|
|
28
|
+
window.dataLayer.push({ event: 'jotform_form_submitted', form_id: match[1] });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
})();
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
|
|
2
|
+
/* eslint-disable prefer-const, pickier/no-unused-vars */
|
|
3
|
+
/*! Ninja Forms conversion detection (MIT)
|
|
4
|
+
* Detects: form submission. Pushes dataLayer event: ninja_forms_submitted
|
|
5
|
+
* From the conversion-tracking skill in Marketing Skills */
|
|
6
|
+
(function () {
|
|
7
|
+
'use strict';
|
|
8
|
+
var runtime = window.__ctNinjaFormsRuntime;
|
|
9
|
+
if (runtime && runtime.installed) return;
|
|
10
|
+
|
|
11
|
+
// Preserve the recipe's public duplicate-install guard. If a superseded
|
|
12
|
+
// snippet already set it without this runtime, fail closed: don't layer a
|
|
13
|
+
// second listener over an unknown old detector.
|
|
14
|
+
if (!runtime && window.__ctDetectNinjaForms) return;
|
|
15
|
+
|
|
16
|
+
if (!runtime) {
|
|
17
|
+
runtime = { seenEntryIds: Object.create(null), installed: false };
|
|
18
|
+
window.__ctNinjaFormsRuntime = runtime;
|
|
19
|
+
}
|
|
20
|
+
window.__ctDetectNinjaForms = true;
|
|
21
|
+
window.dataLayer = window.dataLayer || [];
|
|
22
|
+
|
|
23
|
+
var MISSING = {};
|
|
24
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
25
|
+
|
|
26
|
+
// Read only own data properties. Callback payloads are normally parsed JSON,
|
|
27
|
+
// but a filter or another page script can supply accessor-backed objects.
|
|
28
|
+
// Do not execute getters while deciding whether a response proves a save.
|
|
29
|
+
function ownDataValue(object, key) {
|
|
30
|
+
if (!object || typeof object !== 'object' || !Object.prototype.hasOwnProperty.call(object, key)) return MISSING;
|
|
31
|
+
if (typeof Object.getOwnPropertyDescriptor !== 'function') return MISSING;
|
|
32
|
+
var descriptor = Object.getOwnPropertyDescriptor(object, key);
|
|
33
|
+
if (!descriptor || !Object.prototype.hasOwnProperty.call(descriptor, 'value')) return MISSING;
|
|
34
|
+
return descriptor.value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function emptyErrors(value) {
|
|
38
|
+
if (Object.prototype.toString.call(value) === '[object Array]') return value.length === 0;
|
|
39
|
+
if (!value || typeof value !== 'object') return false;
|
|
40
|
+
for (var key in value) {
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(value, key)) return false;
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Accept only primitive safe integers or canonical decimal strings. Never
|
|
47
|
+
// coerce booleans, arrays, objects, boxed numbers, or accessor-backed IDs.
|
|
48
|
+
function positiveIntegerId(value) {
|
|
49
|
+
if (typeof value === 'number') {
|
|
50
|
+
if (!isFinite(value) || value <= 0 || Math.floor(value) !== value || value > MAX_SAFE_INTEGER) return null;
|
|
51
|
+
return String(value);
|
|
52
|
+
}
|
|
53
|
+
if (typeof value !== 'string' || !/^[1-9]\d*$/.test(value)) return null;
|
|
54
|
+
var number = Number(value);
|
|
55
|
+
if (!isFinite(number) || number > MAX_SAFE_INTEGER || String(number) !== value) return null;
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function canonicalFormId(value) {
|
|
60
|
+
var formId;
|
|
61
|
+
if (typeof value === 'number') {
|
|
62
|
+
if (!isFinite(value) || value <= 0 || Math.floor(value) !== value || value > MAX_SAFE_INTEGER) return null;
|
|
63
|
+
formId = String(value);
|
|
64
|
+
} else if (typeof value === 'string') {
|
|
65
|
+
formId = value;
|
|
66
|
+
} else {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
if (!/^[1-9]\d*(?:_(?:0|[1-9]\d*))*$/.test(formId)) return null;
|
|
70
|
+
var parts = formId.split('_');
|
|
71
|
+
for (var i = 0; i < parts.length; i++) {
|
|
72
|
+
var part = Number(parts[i]);
|
|
73
|
+
if (!isFinite(part) || part > MAX_SAFE_INTEGER || String(part) !== parts[i]) return null;
|
|
74
|
+
}
|
|
75
|
+
return formId;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function inspectResponse(response, callbackFormId) {
|
|
79
|
+
var errors = ownDataValue(response, 'errors');
|
|
80
|
+
if (errors === MISSING || !emptyErrors(errors)) return null;
|
|
81
|
+
var data = ownDataValue(response, 'data');
|
|
82
|
+
if (!data || typeof data !== 'object') return null;
|
|
83
|
+
var halt = ownDataValue(data, 'halt');
|
|
84
|
+
if (halt !== MISSING && halt) return null;
|
|
85
|
+
var nestedErrors = ownDataValue(data, 'errors');
|
|
86
|
+
if (nestedErrors !== MISSING && !emptyErrors(nestedErrors)) return null;
|
|
87
|
+
var formValue = ownDataValue(data, 'form_id');
|
|
88
|
+
var formId = formValue === MISSING ? null : canonicalFormId(formValue);
|
|
89
|
+
if (!formId || canonicalFormId(callbackFormId) !== formId) return null;
|
|
90
|
+
var actions = ownDataValue(data, 'actions');
|
|
91
|
+
if (!actions || typeof actions !== 'object') return null;
|
|
92
|
+
var save = ownDataValue(actions, 'save');
|
|
93
|
+
if (!save || typeof save !== 'object') return null;
|
|
94
|
+
var saveValue = ownDataValue(save, 'sub_id');
|
|
95
|
+
var entryId = saveValue === MISSING ? null : positiveIntegerId(saveValue);
|
|
96
|
+
if (!entryId) return null;
|
|
97
|
+
return { formId: formId, entryId: entryId };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
runtime.inspectResponse = inspectResponse;
|
|
101
|
+
|
|
102
|
+
function handleSubmitResponse(response, textStatus, jqXHR, callbackFormId) {
|
|
103
|
+
var accepted = inspectResponse(response, callbackFormId);
|
|
104
|
+
if (!accepted) {
|
|
105
|
+
if (typeof window.__ctNinjaMethod2AfterResponse === 'function') {
|
|
106
|
+
window.__ctNinjaMethod2AfterResponse(callbackFormId, false, false);
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
var key = '$' + accepted.entryId;
|
|
112
|
+
if (runtime.seenEntryIds[key]) {
|
|
113
|
+
if (typeof window.__ctNinjaMethod2AfterResponse === 'function') {
|
|
114
|
+
window.__ctNinjaMethod2AfterResponse(accepted.formId, false, true);
|
|
115
|
+
}
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
runtime.seenEntryIds[key] = true;
|
|
119
|
+
|
|
120
|
+
var enriched = false;
|
|
121
|
+
if (typeof window.__ctNinjaMethod2Emit === 'function') {
|
|
122
|
+
try {
|
|
123
|
+
enriched = window.__ctNinjaMethod2Emit(accepted.formId, accepted.entryId) === true;
|
|
124
|
+
} catch (e) {
|
|
125
|
+
enriched = false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!enriched) {
|
|
129
|
+
window.dataLayer.push({ event: 'ninja_forms_submitted', form_id: accepted.formId });
|
|
130
|
+
}
|
|
131
|
+
if (typeof window.__ctNinjaMethod2AfterResponse === 'function') {
|
|
132
|
+
window.__ctNinjaMethod2AfterResponse(accepted.formId, true, false);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function hookNfRadio() {
|
|
137
|
+
if (runtime.installed) return true;
|
|
138
|
+
var radio = typeof nfRadio !== 'undefined' && nfRadio.channel ? nfRadio :
|
|
139
|
+
(typeof Backbone !== 'undefined' && Backbone.Radio ? Backbone.Radio : null);
|
|
140
|
+
if (!radio) return false;
|
|
141
|
+
try {
|
|
142
|
+
radio.channel('forms').on('submit:response', handleSubmitResponse);
|
|
143
|
+
runtime.installed = true;
|
|
144
|
+
return true;
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (!hookNfRadio()) {
|
|
151
|
+
document.addEventListener('DOMContentLoaded', hookNfRadio);
|
|
152
|
+
window.addEventListener('load', hookNfRadio);
|
|
153
|
+
}
|
|
154
|
+
})();
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
|
|
2
|
+
/* eslint-disable prefer-const, pickier/no-unused-vars */
|
|
3
|
+
/*! Phone call click detection (MIT)
|
|
4
|
+
* Detects: click on a tel: link. Pushes dataLayer event: phone_click
|
|
5
|
+
* From the conversion-tracking skill in Marketing Skills */
|
|
6
|
+
(function () {
|
|
7
|
+
if (window.__ctDetectPhoneClick) return;
|
|
8
|
+
window.__ctDetectPhoneClick = true;
|
|
9
|
+
window.dataLayer = window.dataLayer || [];
|
|
10
|
+
|
|
11
|
+
// A click is a call INTENT, not a completed call. On desktop especially,
|
|
12
|
+
// many tel: clicks never become a conversation. Count it as a lead signal,
|
|
13
|
+
// and prefer a call tracking number if you need answered-call accuracy.
|
|
14
|
+
|
|
15
|
+
// Ignore a repeat click on the same number inside this window. Impatient
|
|
16
|
+
// double-taps on mobile are common and would otherwise double count.
|
|
17
|
+
var DEDUPE_MS = 2000;
|
|
18
|
+
var lastNumber = null;
|
|
19
|
+
var lastAt = 0;
|
|
20
|
+
|
|
21
|
+
function normalise(href) {
|
|
22
|
+
// tel:+61 (2) 1234-5678 -> +61212345678 . Keeps a leading +, drops the
|
|
23
|
+
// punctuation humans put in phone numbers so dedupe compares like for like.
|
|
24
|
+
var raw = String(href || '').replace(/^tel:/i, '');
|
|
25
|
+
try { raw = decodeURIComponent(raw); } catch (e) { /* leave as-is */ }
|
|
26
|
+
var plus = raw.trim().charAt(0) === '+' ? '+' : '';
|
|
27
|
+
return plus + raw.replace(/[^0-9]/g, '');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function handleClick(event) {
|
|
31
|
+
try {
|
|
32
|
+
// Left click only, and not a modified click that opens elsewhere.
|
|
33
|
+
if (event.button !== undefined && event.button !== 0) return;
|
|
34
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
35
|
+
|
|
36
|
+
var target = event.target;
|
|
37
|
+
if (!target || !target.closest) return;
|
|
38
|
+
|
|
39
|
+
// closest() because the click usually lands on an icon or span INSIDE
|
|
40
|
+
// the anchor, not the anchor itself.
|
|
41
|
+
var link = target.closest('a[href^="tel:"], a[href^="TEL:"]');
|
|
42
|
+
if (!link) return;
|
|
43
|
+
|
|
44
|
+
var number = normalise(link.getAttribute('href'));
|
|
45
|
+
if (!number) return;
|
|
46
|
+
|
|
47
|
+
var now = new Date().getTime();
|
|
48
|
+
if (number === lastNumber && (now - lastAt) < DEDUPE_MS) return;
|
|
49
|
+
lastNumber = number;
|
|
50
|
+
lastAt = now;
|
|
51
|
+
|
|
52
|
+
// PII: if the site shows visitor-specific numbers (an account page, a
|
|
53
|
+
// CRM-driven "your rep" number), drop phone_number and link_text here.
|
|
54
|
+
window.dataLayer.push({
|
|
55
|
+
event: 'phone_click',
|
|
56
|
+
phone_number: number,
|
|
57
|
+
// The visible text, useful when a site shows different numbers per
|
|
58
|
+
// location or campaign. Trimmed and capped so a whole button's worth
|
|
59
|
+
// of markup text never lands in the dataLayer.
|
|
60
|
+
link_text: (link.textContent || '').trim().slice(0, 100),
|
|
61
|
+
page_path: window.location.pathname
|
|
62
|
+
});
|
|
63
|
+
} catch (e) {
|
|
64
|
+
// Never throw back into the page's own click handling.
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Bubble phase: a tel: click has no validation to lose a race with, and
|
|
69
|
+
// bubbling means anything that legitimately cancels the click wins first.
|
|
70
|
+
document.addEventListener('click', handleClick, false);
|
|
71
|
+
})();
|