@stacksjs/defaults 0.75.515 → 0.75.518

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.
Files changed (435) hide show
  1. package/ai/AGENTS.md +2 -2
  2. package/ai/skills/stacks-buddy/SKILL.md +1 -1
  3. package/ai/skills/stacks-build/SKILL.md +10 -0
  4. package/ai/skills/stacks-chief-of-staff/NOTICE.md +2 -2
  5. package/ai/skills/stacks-chief-of-staff/PLAYBOOK.md +32 -2
  6. package/ai/skills/stacks-codebase-design/DESIGN-IT-TWICE.md +1 -2
  7. package/ai/skills/stacks-codebase-design/NOTICE.md +2 -2
  8. package/ai/skills/stacks-docs/SKILL.md +78 -80
  9. package/ai/skills/stacks-domain-modeling/NOTICE.md +2 -2
  10. package/ai/skills/stacks-flow/ENGINEERING.md +3 -0
  11. package/ai/skills/stacks-flow/NOTICE.md +2 -2
  12. package/ai/skills/stacks-flow/upstream-skills.json +121 -90
  13. package/ai/skills/stacks-git/NOTICE.md +2 -2
  14. package/ai/skills/stacks-grill-with-docs/NOTICE.md +2 -2
  15. package/ai/skills/stacks-grilling/NOTICE.md +4 -4
  16. package/ai/skills/stacks-guard/NOTICE.md +2 -2
  17. package/ai/skills/stacks-handoff/NOTICE.md +4 -4
  18. package/ai/skills/stacks-implement/NOTICE.md +2 -2
  19. package/ai/skills/stacks-implement-spec/NOTICE.md +2 -2
  20. package/ai/skills/stacks-implement-spec/PLAYBOOK.md +4 -2
  21. package/ai/skills/stacks-improve-codebase-architecture/NOTICE.md +2 -2
  22. package/ai/skills/stacks-improve-codebase-architecture/PLAYBOOK.md +1 -1
  23. package/ai/skills/stacks-investigate/NOTICE.md +2 -2
  24. package/ai/skills/stacks-loop/NOTICE.md +2 -2
  25. package/ai/skills/stacks-marketing/CATALOG.md +5 -2
  26. package/ai/skills/stacks-marketing/NOTICE.md +2 -2
  27. package/ai/skills/stacks-marketing/SKILL.md +1 -1
  28. package/ai/skills/stacks-marketing-ab-testing/NOTICE.md +2 -2
  29. package/ai/skills/stacks-marketing-ab-testing/PLAYBOOK.md +9 -4
  30. package/ai/skills/stacks-marketing-ab-testing/SKILL.md +1 -1
  31. package/ai/skills/stacks-marketing-ab-testing/references/sample-size-guide.md +42 -27
  32. package/ai/skills/stacks-marketing-ad-creative/NOTICE.md +2 -2
  33. package/ai/skills/stacks-marketing-ad-creative/PLAYBOOK.md +41 -11
  34. package/ai/skills/stacks-marketing-ad-creative/SKILL.md +1 -1
  35. package/ai/skills/stacks-marketing-ad-creative/evals/evals.json +1 -1
  36. package/ai/skills/stacks-marketing-ad-creative/references/generative-tools.md +47 -51
  37. package/ai/skills/stacks-marketing-ad-creative/references/hook-system.md +7 -0
  38. package/ai/skills/stacks-marketing-ad-creative/references/imessage-video-ads.md +2 -2
  39. package/ai/skills/stacks-marketing-ads/NOTICE.md +2 -2
  40. package/ai/skills/stacks-marketing-ads/PLAYBOOK.md +37 -28
  41. package/ai/skills/stacks-marketing-ads/SKILL.md +1 -1
  42. package/ai/skills/stacks-marketing-ads/evals/evals.json +53 -0
  43. package/ai/skills/stacks-marketing-ads/references/abm-playbook.md +1 -1
  44. package/ai/skills/stacks-marketing-ads/references/audit-guardrails.md +11 -1
  45. package/ai/skills/stacks-marketing-ads/references/creative-research-automation.md +19 -0
  46. package/ai/skills/stacks-marketing-ads/references/google-ads-audit-checklist.md +35 -2
  47. package/ai/skills/stacks-marketing-ads/references/google-search-playbook.md +4 -0
  48. package/ai/skills/stacks-marketing-ads/references/linkedin-b2b-playbook.md +2 -0
  49. package/ai/skills/stacks-marketing-ads/references/meta-andromeda-playbook.md +33 -0
  50. package/ai/skills/stacks-marketing-ads/references/operating-check.md +75 -0
  51. package/ai/skills/stacks-marketing-ads/references/reading-google-ads-data.md +1 -1
  52. package/ai/skills/stacks-marketing-ai-seo/NOTICE.md +2 -2
  53. package/ai/skills/stacks-marketing-ai-seo/PLAYBOOK.md +32 -30
  54. package/ai/skills/stacks-marketing-ai-seo/SKILL.md +1 -1
  55. package/ai/skills/stacks-marketing-ai-seo/evals/evals.json +27 -0
  56. package/ai/skills/stacks-marketing-ai-seo/references/agent-defaults.md +79 -0
  57. package/ai/skills/stacks-marketing-ai-seo/references/agent-readiness.md +61 -11
  58. package/ai/skills/stacks-marketing-ai-seo/references/ai-attribution.md +54 -0
  59. package/ai/skills/stacks-marketing-ai-seo/references/answer-accuracy.md +84 -0
  60. package/ai/skills/stacks-marketing-ai-seo/references/citations-vs-recommendations.md +32 -1
  61. package/ai/skills/stacks-marketing-ai-seo/references/content-patterns.md +24 -0
  62. package/ai/skills/stacks-marketing-ai-seo/references/multilingual-and-commerce.md +55 -0
  63. package/ai/skills/stacks-marketing-ai-seo/references/platform-ranking-factors.md +31 -11
  64. package/ai/skills/stacks-marketing-ai-seo/references/prompt-portfolio.md +97 -0
  65. package/ai/skills/stacks-marketing-analytics/NOTICE.md +2 -2
  66. package/ai/skills/stacks-marketing-analytics/PLAYBOOK.md +74 -15
  67. package/ai/skills/stacks-marketing-analytics/SKILL.md +1 -1
  68. package/ai/skills/stacks-marketing-analytics/references/event-library.md +2 -2
  69. package/ai/skills/stacks-marketing-analytics/references/ga4-implementation.md +3 -3
  70. package/ai/skills/stacks-marketing-aso/NOTICE.md +2 -2
  71. package/ai/skills/stacks-marketing-aso/SKILL.md +1 -1
  72. package/ai/skills/stacks-marketing-aso/references/apple-specs.md +1 -1
  73. package/ai/skills/stacks-marketing-aso/references/scoring-criteria.md +3 -3
  74. package/ai/skills/stacks-marketing-attribution/NOTICE.md +2 -2
  75. package/ai/skills/stacks-marketing-attribution/PLAYBOOK.md +11 -11
  76. package/ai/skills/stacks-marketing-attribution/SKILL.md +1 -1
  77. package/ai/skills/stacks-marketing-attribution/references/by-business-type.md +1 -1
  78. package/ai/skills/stacks-marketing-attribution/references/measurement-paradigms.md +4 -3
  79. package/ai/skills/stacks-marketing-churn-prevention/NOTICE.md +2 -2
  80. package/ai/skills/stacks-marketing-churn-prevention/PLAYBOOK.md +14 -4
  81. package/ai/skills/stacks-marketing-churn-prevention/SKILL.md +1 -1
  82. package/ai/skills/stacks-marketing-churn-prevention/references/dunning-playbook.md +10 -7
  83. package/ai/skills/stacks-marketing-co-marketing/NOTICE.md +2 -2
  84. package/ai/skills/stacks-marketing-co-marketing/PLAYBOOK.md +4 -4
  85. package/ai/skills/stacks-marketing-co-marketing/SKILL.md +1 -1
  86. package/ai/skills/stacks-marketing-co-marketing/references/partnership-types.md +2 -2
  87. package/ai/skills/stacks-marketing-cold-email/NOTICE.md +2 -2
  88. package/ai/skills/stacks-marketing-cold-email/PLAYBOOK.md +6 -6
  89. package/ai/skills/stacks-marketing-cold-email/SKILL.md +1 -1
  90. package/ai/skills/stacks-marketing-cold-email/references/deliverability.md +1 -1
  91. package/ai/skills/stacks-marketing-cold-email/references/follow-up-sequences.md +1 -1
  92. package/ai/skills/stacks-marketing-cold-email/references/multichannel-cadence.md +1 -1
  93. package/ai/skills/stacks-marketing-cold-email/references/outbound-plays.md +1 -1
  94. package/ai/skills/stacks-marketing-cold-email/references/personalization.md +1 -1
  95. package/ai/skills/stacks-marketing-community-marketing/NOTICE.md +2 -2
  96. package/ai/skills/stacks-marketing-community-marketing/PLAYBOOK.md +1 -1
  97. package/ai/skills/stacks-marketing-community-marketing/SKILL.md +1 -1
  98. package/ai/skills/stacks-marketing-community-marketing/references/community-models.md +2 -2
  99. package/ai/skills/stacks-marketing-competitor-profiling/NOTICE.md +2 -2
  100. package/ai/skills/stacks-marketing-competitor-profiling/PLAYBOOK.md +2 -0
  101. package/ai/skills/stacks-marketing-competitor-profiling/SKILL.md +1 -1
  102. package/ai/skills/stacks-marketing-competitors/NOTICE.md +1 -1
  103. package/ai/skills/stacks-marketing-competitors/SKILL.md +1 -1
  104. package/ai/skills/stacks-marketing-content-strategy/NOTICE.md +2 -2
  105. package/ai/skills/stacks-marketing-content-strategy/PLAYBOOK.md +4 -1
  106. package/ai/skills/stacks-marketing-content-strategy/SKILL.md +1 -1
  107. package/ai/skills/stacks-marketing-content-strategy/references/headless-cms.md +3 -3
  108. package/ai/skills/stacks-marketing-conversion-tracking/LICENSE +21 -0
  109. package/ai/skills/stacks-marketing-conversion-tracking/NOTICE.md +12 -0
  110. package/ai/skills/stacks-marketing-conversion-tracking/PLAYBOOK.md +164 -0
  111. package/ai/skills/stacks-marketing-conversion-tracking/SKILL.md +16 -0
  112. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/README.md +61 -0
  113. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-acuity-scheduling.json +160 -0
  114. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-cal-com.json +141 -0
  115. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-calendly.json +122 -0
  116. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-contact-form-7.json +103 -0
  117. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-divi-forms.json +103 -0
  118. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-elementor-forms.json +103 -0
  119. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-file-download.json +81 -0
  120. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-fluent-forms.json +104 -0
  121. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-formidable-forms.json +103 -0
  122. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-forminator.json +103 -0
  123. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-framer-forms.json +103 -0
  124. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-generic-ajax-form.json +81 -0
  125. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-gravity-forms.json +103 -0
  126. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-hubspot-forms.json +103 -0
  127. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-jotform.json +103 -0
  128. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-ninja-forms.json +103 -0
  129. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-phone-click.json +81 -0
  130. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-squarespace-forms.json +122 -0
  131. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-tally.json +122 -0
  132. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-thank-you-page.json +81 -0
  133. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-typeform.json +122 -0
  134. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-webflow-forms.json +103 -0
  135. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-wix-forms.json +103 -0
  136. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-wix-scheduling.json +103 -0
  137. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-wpforms.json +103 -0
  138. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/detect/detect-ws-form.json +103 -0
  139. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/event-map.json +132 -0
  140. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/ga4.json +58 -0
  141. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/google-ads.json +76 -0
  142. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/linkedin.json +128 -0
  143. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/meta.json +128 -0
  144. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/microsoft.json +128 -0
  145. package/ai/skills/stacks-marketing-conversion-tracking/assets/gtm-recipes/send/tiktok.json +128 -0
  146. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/README.md +112 -0
  147. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/acuity-scheduling-field.html +28 -0
  148. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/acuity-scheduling.js +75 -0
  149. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/cal-com.js +134 -0
  150. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/calendly.js +113 -0
  151. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/contact-form-7.js +101 -0
  152. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/divi-forms.js +54 -0
  153. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/elementor-forms.js +54 -0
  154. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/file-download.js +96 -0
  155. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/fluent-forms.js +103 -0
  156. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/formidable-forms.js +203 -0
  157. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/forminator.js +65 -0
  158. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/framer-forms.js +96 -0
  159. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/generic-ajax-form.js +165 -0
  160. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/gravity-forms.js +234 -0
  161. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/hubspot-forms.js +162 -0
  162. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/jotform.js +32 -0
  163. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/ninja-forms.js +154 -0
  164. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/phone-click.js +71 -0
  165. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/squarespace-forms.js +428 -0
  166. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/tally.js +167 -0
  167. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/thank-you-page.js +87 -0
  168. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/typeform.js +147 -0
  169. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/webflow-forms.js +57 -0
  170. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/wix-forms.js +232 -0
  171. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/wix-scheduling.js +80 -0
  172. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/wpforms.js +198 -0
  173. package/ai/skills/stacks-marketing-conversion-tracking/assets/snippets/ws-form.js +57 -0
  174. package/ai/skills/stacks-marketing-conversion-tracking/evals/evals.json +264 -0
  175. package/ai/skills/stacks-marketing-conversion-tracking/references/audit-playbook.md +106 -0
  176. package/ai/skills/stacks-marketing-conversion-tracking/references/browser-side.md +424 -0
  177. package/ai/skills/stacks-marketing-conversion-tracking/references/conversion-moments.md +318 -0
  178. package/ai/skills/stacks-marketing-conversion-tracking/references/discrepancies.md +136 -0
  179. package/ai/skills/stacks-marketing-conversion-tracking/references/ecommerce-platforms.md +71 -0
  180. package/ai/skills/stacks-marketing-conversion-tracking/references/google-ads.md +316 -0
  181. package/ai/skills/stacks-marketing-conversion-tracking/references/meta.md +202 -0
  182. package/ai/skills/stacks-marketing-conversion-tracking/references/other-platforms.md +201 -0
  183. package/ai/skills/stacks-marketing-conversion-tracking/references/server-side.md +167 -0
  184. package/ai/skills/stacks-marketing-conversion-tracking/scripts/build-recipe.ts +140 -0
  185. package/ai/skills/stacks-marketing-copy-editing/NOTICE.md +2 -2
  186. package/ai/skills/stacks-marketing-copy-editing/PLAYBOOK.md +3 -1
  187. package/ai/skills/stacks-marketing-copy-editing/SKILL.md +1 -1
  188. package/ai/skills/stacks-marketing-copy-editing/evals/evals.json +13 -0
  189. package/ai/skills/stacks-marketing-copy-editing/references/checklist.md +24 -0
  190. package/ai/skills/stacks-marketing-copywriting/NOTICE.md +2 -2
  191. package/ai/skills/stacks-marketing-copywriting/PLAYBOOK.md +55 -2
  192. package/ai/skills/stacks-marketing-copywriting/SKILL.md +1 -1
  193. package/ai/skills/stacks-marketing-copywriting/evals/evals.json +14 -0
  194. package/ai/skills/stacks-marketing-copywriting/references/ai-tells.md +48 -0
  195. package/ai/skills/stacks-marketing-copywriting/references/copy-frameworks.md +1 -1
  196. package/ai/skills/stacks-marketing-council/NOTICE.md +1 -1
  197. package/ai/skills/stacks-marketing-council/SKILL.md +1 -1
  198. package/ai/skills/stacks-marketing-cro/NOTICE.md +1 -1
  199. package/ai/skills/stacks-marketing-cro/PLAYBOOK.md +1 -1
  200. package/ai/skills/stacks-marketing-cro/SKILL.md +1 -1
  201. package/ai/skills/stacks-marketing-customer-research/NOTICE.md +2 -2
  202. package/ai/skills/stacks-marketing-customer-research/PLAYBOOK.md +1 -1
  203. package/ai/skills/stacks-marketing-customer-research/SKILL.md +1 -1
  204. package/ai/skills/stacks-marketing-customer-research/references/source-guides.md +1 -1
  205. package/ai/skills/stacks-marketing-directory-submissions/NOTICE.md +2 -2
  206. package/ai/skills/stacks-marketing-directory-submissions/PLAYBOOK.md +6 -5
  207. package/ai/skills/stacks-marketing-directory-submissions/SKILL.md +1 -1
  208. package/ai/skills/stacks-marketing-directory-submissions/evals/evals.json +14 -2
  209. package/ai/skills/stacks-marketing-directory-submissions/references/directory-list.md +4 -4
  210. package/ai/skills/stacks-marketing-directory-submissions/references/positioning-variations.md +1 -1
  211. package/ai/skills/stacks-marketing-directory-submissions/references/submission-tracker-template.csv +1 -1
  212. package/ai/skills/stacks-marketing-emails/NOTICE.md +2 -2
  213. package/ai/skills/stacks-marketing-emails/PLAYBOOK.md +9 -7
  214. package/ai/skills/stacks-marketing-emails/SKILL.md +1 -1
  215. package/ai/skills/stacks-marketing-events/NOTICE.md +1 -1
  216. package/ai/skills/stacks-marketing-events/SKILL.md +1 -1
  217. package/ai/skills/stacks-marketing-free-tools/NOTICE.md +2 -2
  218. package/ai/skills/stacks-marketing-free-tools/PLAYBOOK.md +6 -5
  219. package/ai/skills/stacks-marketing-free-tools/SKILL.md +1 -1
  220. package/ai/skills/stacks-marketing-free-tools/evals/evals.json +3 -2
  221. package/ai/skills/stacks-marketing-free-tools/references/tool-benchmarks.md +24 -23
  222. package/ai/skills/stacks-marketing-ideas/NOTICE.md +2 -2
  223. package/ai/skills/stacks-marketing-ideas/PLAYBOOK.md +1 -0
  224. package/ai/skills/stacks-marketing-ideas/SKILL.md +1 -1
  225. package/ai/skills/stacks-marketing-image/NOTICE.md +2 -2
  226. package/ai/skills/stacks-marketing-image/PLAYBOOK.md +6 -6
  227. package/ai/skills/stacks-marketing-image/SKILL.md +1 -1
  228. package/ai/skills/stacks-marketing-image/references/ai-image-prompting.md +5 -5
  229. package/ai/skills/stacks-marketing-influencer-marketing/NOTICE.md +2 -2
  230. package/ai/skills/stacks-marketing-influencer-marketing/PLAYBOOK.md +11 -4
  231. package/ai/skills/stacks-marketing-influencer-marketing/SKILL.md +1 -1
  232. package/ai/skills/stacks-marketing-influencer-marketing/evals/evals.json +14 -0
  233. package/ai/skills/stacks-marketing-influencer-marketing/references/newsletter-sponsorships.md +76 -0
  234. package/ai/skills/stacks-marketing-influencer-marketing/references/paid-ads-creator-program.md +79 -0
  235. package/ai/skills/stacks-marketing-influencer-marketing/references/telegram-channels.md +111 -0
  236. package/ai/skills/stacks-marketing-launch/NOTICE.md +1 -1
  237. package/ai/skills/stacks-marketing-launch/PLAYBOOK.md +1 -1
  238. package/ai/skills/stacks-marketing-launch/SKILL.md +1 -1
  239. package/ai/skills/stacks-marketing-launch/references/site-launch-qa.md +2 -2
  240. package/ai/skills/stacks-marketing-lead-magnets/NOTICE.md +2 -2
  241. package/ai/skills/stacks-marketing-lead-magnets/PLAYBOOK.md +1 -2
  242. package/ai/skills/stacks-marketing-lead-magnets/SKILL.md +1 -1
  243. package/ai/skills/stacks-marketing-link-building/LICENSE +21 -0
  244. package/ai/skills/stacks-marketing-link-building/NOTICE.md +8 -0
  245. package/ai/skills/stacks-marketing-link-building/PLAYBOOK.md +167 -0
  246. package/ai/skills/stacks-marketing-link-building/SKILL.md +16 -0
  247. package/ai/skills/stacks-marketing-link-building/evals/evals.json +71 -0
  248. package/ai/skills/stacks-marketing-link-building/references/prospecting-and-outreach.md +114 -0
  249. package/ai/skills/stacks-marketing-link-building/references/risk-policy.md +56 -0
  250. package/ai/skills/stacks-marketing-link-building/references/tactics.md +106 -0
  251. package/ai/skills/stacks-marketing-loops/NOTICE.md +2 -2
  252. package/ai/skills/stacks-marketing-loops/PLAYBOOK.md +3 -2
  253. package/ai/skills/stacks-marketing-loops/SKILL.md +2 -2
  254. package/ai/skills/stacks-marketing-loops/references/loop-catalog.md +131 -14
  255. package/ai/skills/stacks-marketing-loops/references/loop-orchestration.md +2 -2
  256. package/ai/skills/stacks-marketing-loops/references/loop-state.md +21 -0
  257. package/ai/skills/stacks-marketing-loops/references/seo-operator.md +1 -1
  258. package/ai/skills/stacks-marketing-offers/NOTICE.md +2 -2
  259. package/ai/skills/stacks-marketing-offers/PLAYBOOK.md +1 -1
  260. package/ai/skills/stacks-marketing-offers/SKILL.md +1 -1
  261. package/ai/skills/stacks-marketing-offers/evals/evals.json +13 -0
  262. package/ai/skills/stacks-marketing-offers/references/offer-formats.md +1 -1
  263. package/ai/skills/stacks-marketing-onboarding/NOTICE.md +2 -2
  264. package/ai/skills/stacks-marketing-onboarding/PLAYBOOK.md +10 -4
  265. package/ai/skills/stacks-marketing-onboarding/SKILL.md +1 -1
  266. package/ai/skills/stacks-marketing-onboarding/evals/evals.json +2 -2
  267. package/ai/skills/stacks-marketing-onboarding/references/activation-models.md +4 -1
  268. package/ai/skills/stacks-marketing-paywalls/NOTICE.md +2 -2
  269. package/ai/skills/stacks-marketing-paywalls/PLAYBOOK.md +3 -0
  270. package/ai/skills/stacks-marketing-paywalls/SKILL.md +1 -1
  271. package/ai/skills/stacks-marketing-paywalls/evals/evals.json +15 -0
  272. package/ai/skills/stacks-marketing-paywalls/references/experiments.md +7 -3
  273. package/ai/skills/stacks-marketing-paywalls/references/mobile-subscription-paywalls.md +69 -0
  274. package/ai/skills/stacks-marketing-plan/NOTICE.md +2 -2
  275. package/ai/skills/stacks-marketing-plan/PLAYBOOK.md +5 -0
  276. package/ai/skills/stacks-marketing-plan/SKILL.md +1 -1
  277. package/ai/skills/stacks-marketing-popups/NOTICE.md +2 -2
  278. package/ai/skills/stacks-marketing-popups/PLAYBOOK.md +1 -2
  279. package/ai/skills/stacks-marketing-popups/SKILL.md +1 -1
  280. package/ai/skills/stacks-marketing-pricing/NOTICE.md +2 -2
  281. package/ai/skills/stacks-marketing-pricing/SKILL.md +1 -1
  282. package/ai/skills/stacks-marketing-pricing/references/research-methods.md +12 -2
  283. package/ai/skills/stacks-marketing-product-marketing/NOTICE.md +2 -2
  284. package/ai/skills/stacks-marketing-product-marketing/PLAYBOOK.md +72 -7
  285. package/ai/skills/stacks-marketing-product-marketing/SKILL.md +1 -1
  286. package/ai/skills/stacks-marketing-product-marketing/references/brand-voice.md +103 -0
  287. package/ai/skills/stacks-marketing-programmatic-seo/NOTICE.md +2 -2
  288. package/ai/skills/stacks-marketing-programmatic-seo/PLAYBOOK.md +1 -1
  289. package/ai/skills/stacks-marketing-programmatic-seo/SKILL.md +1 -1
  290. package/ai/skills/stacks-marketing-programmatic-seo/references/implementation-platforms.md +2 -2
  291. package/ai/skills/stacks-marketing-programmatic-seo/references/playbooks.md +1 -1
  292. package/ai/skills/stacks-marketing-prospecting/NOTICE.md +2 -2
  293. package/ai/skills/stacks-marketing-prospecting/PLAYBOOK.md +18 -18
  294. package/ai/skills/stacks-marketing-prospecting/SKILL.md +1 -1
  295. package/ai/skills/stacks-marketing-prospecting/evals/evals.json +28 -0
  296. package/ai/skills/stacks-marketing-prospecting/references/data-sources.md +12 -12
  297. package/ai/skills/stacks-marketing-prospecting/references/enrichment-playbook.md +1 -1
  298. package/ai/skills/stacks-marketing-prospecting/references/signal-plays.md +44 -2
  299. package/ai/skills/stacks-marketing-psychology/NOTICE.md +1 -1
  300. package/ai/skills/stacks-marketing-psychology/SKILL.md +1 -1
  301. package/ai/skills/stacks-marketing-public-relations/NOTICE.md +2 -2
  302. package/ai/skills/stacks-marketing-public-relations/PLAYBOOK.md +3 -0
  303. package/ai/skills/stacks-marketing-public-relations/SKILL.md +1 -1
  304. package/ai/skills/stacks-marketing-referrals/NOTICE.md +2 -2
  305. package/ai/skills/stacks-marketing-referrals/PLAYBOOK.md +8 -8
  306. package/ai/skills/stacks-marketing-referrals/SKILL.md +1 -1
  307. package/ai/skills/stacks-marketing-referrals/references/affiliate-programs.md +1 -1
  308. package/ai/skills/stacks-marketing-referrals/references/program-examples.md +9 -2
  309. package/ai/skills/stacks-marketing-referrals/references/review-programs.md +1 -1
  310. package/ai/skills/stacks-marketing-reverse-engineer-marketing/LICENSE +21 -0
  311. package/ai/skills/stacks-marketing-reverse-engineer-marketing/NOTICE.md +8 -0
  312. package/ai/skills/stacks-marketing-reverse-engineer-marketing/PLAYBOOK.md +312 -0
  313. package/ai/skills/stacks-marketing-reverse-engineer-marketing/SKILL.md +21 -0
  314. package/ai/skills/stacks-marketing-reverse-engineer-marketing/evals/evals.json +242 -0
  315. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/content-teardown.md +97 -0
  316. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/data-sources.md +147 -0
  317. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/funnel-hack.md +96 -0
  318. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/go-inside.md +107 -0
  319. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/hidden-signals.md +78 -0
  320. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/agencies-b2b-services.md +84 -0
  321. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/automotive.md +86 -0
  322. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/care-services.md +83 -0
  323. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/consumer-hardware.md +87 -0
  324. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/cpg-food-beverage.md +85 -0
  325. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/crypto-web3.md +86 -0
  326. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/ecommerce-dtc.md +93 -0
  327. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/education.md +86 -0
  328. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/events-entertainment.md +88 -0
  329. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/finance.md +92 -0
  330. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/fitness-wellness.md +86 -0
  331. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/franchising.md +84 -0
  332. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/gambling-betting.md +85 -0
  333. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/games-pc-console.md +84 -0
  334. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/govtech-public-sector.md +86 -0
  335. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/healthcare.md +88 -0
  336. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/hospitality-travel.md +86 -0
  337. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/insurance.md +87 -0
  338. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/legal-professional-services.md +86 -0
  339. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/local-services.md +88 -0
  340. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/logistics-transportation.md +87 -0
  341. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/manufacturing-industrial.md +84 -0
  342. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/marketplaces.md +85 -0
  343. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/media-creators.md +85 -0
  344. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/mobile-apps-games.md +96 -0
  345. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/nonprofit.md +84 -0
  346. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/real-estate.md +87 -0
  347. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/regulated-goods.md +88 -0
  348. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/retail.md +88 -0
  349. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/saas.md +91 -0
  350. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/industries/solar-home-energy.md +84 -0
  351. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/landscape.md +85 -0
  352. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/play-routing.md +73 -0
  353. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/playbook-template.md +133 -0
  354. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/team-voices.md +71 -0
  355. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/timeline-analysis.md +62 -0
  356. package/ai/skills/stacks-marketing-reverse-engineer-marketing/references/weak-spots.md +70 -0
  357. package/ai/skills/stacks-marketing-revops/NOTICE.md +2 -2
  358. package/ai/skills/stacks-marketing-revops/PLAYBOOK.md +14 -14
  359. package/ai/skills/stacks-marketing-revops/SKILL.md +1 -1
  360. package/ai/skills/stacks-marketing-revops/references/automation-playbooks.md +3 -3
  361. package/ai/skills/stacks-marketing-revops/references/inbound-routing.md +1 -1
  362. package/ai/skills/stacks-marketing-revops/references/lifecycle-definitions.md +2 -0
  363. package/ai/skills/stacks-marketing-revops/references/scoring-models.md +14 -13
  364. package/ai/skills/stacks-marketing-sales-enablement/NOTICE.md +1 -1
  365. package/ai/skills/stacks-marketing-sales-enablement/PLAYBOOK.md +2 -2
  366. package/ai/skills/stacks-marketing-sales-enablement/SKILL.md +1 -1
  367. package/ai/skills/stacks-marketing-sales-enablement/references/cold-call-scripts.md +1 -1
  368. package/ai/skills/stacks-marketing-schema/NOTICE.md +1 -1
  369. package/ai/skills/stacks-marketing-schema/SKILL.md +1 -1
  370. package/ai/skills/stacks-marketing-seo-audit/NOTICE.md +2 -2
  371. package/ai/skills/stacks-marketing-seo-audit/PLAYBOOK.md +5 -4
  372. package/ai/skills/stacks-marketing-seo-audit/SKILL.md +1 -1
  373. package/ai/skills/stacks-marketing-seo-audit/references/international-seo.md +3 -1
  374. package/ai/skills/stacks-marketing-seo-audit/references/rankings-push.md +1 -1
  375. package/ai/skills/stacks-marketing-signup/NOTICE.md +1 -1
  376. package/ai/skills/stacks-marketing-signup/PLAYBOOK.md +1 -1
  377. package/ai/skills/stacks-marketing-signup/SKILL.md +1 -1
  378. package/ai/skills/stacks-marketing-site-architecture/NOTICE.md +1 -1
  379. package/ai/skills/stacks-marketing-site-architecture/SKILL.md +1 -1
  380. package/ai/skills/stacks-marketing-site-architecture/references/platforms-and-migration.md +1 -1
  381. package/ai/skills/stacks-marketing-sms/NOTICE.md +1 -1
  382. package/ai/skills/stacks-marketing-sms/PLAYBOOK.md +9 -9
  383. package/ai/skills/stacks-marketing-sms/SKILL.md +1 -1
  384. package/ai/skills/stacks-marketing-social/NOTICE.md +2 -2
  385. package/ai/skills/stacks-marketing-social/PLAYBOOK.md +5 -4
  386. package/ai/skills/stacks-marketing-social/SKILL.md +1 -1
  387. package/ai/skills/stacks-marketing-social/references/listening.md +13 -0
  388. package/ai/skills/stacks-marketing-social/references/platforms.md +37 -1
  389. package/ai/skills/stacks-marketing-social/references/short-form-video.md +51 -6
  390. package/ai/skills/stacks-marketing-video/NOTICE.md +2 -2
  391. package/ai/skills/stacks-marketing-video/PLAYBOOK.md +35 -18
  392. package/ai/skills/stacks-marketing-video/SKILL.md +1 -1
  393. package/ai/skills/stacks-marketing-video/evals/evals.json +27 -0
  394. package/ai/skills/stacks-marketing-video/references/code-rendered-product-films.md +119 -0
  395. package/ai/skills/stacks-native/CATALOG.md +4 -4
  396. package/ai/skills/stacks-pr/NOTICE.md +2 -2
  397. package/ai/skills/stacks-prototype/NOTICE.md +2 -2
  398. package/ai/skills/stacks-research/NOTICE.md +2 -2
  399. package/ai/skills/stacks-research/PLAYBOOK.md +1 -1
  400. package/ai/skills/stacks-retro/NOTICE.md +2 -2
  401. package/ai/skills/stacks-review/NOTICE.md +2 -2
  402. package/ai/skills/stacks-scaffold-exercises/NOTICE.md +2 -2
  403. package/ai/skills/stacks-setup-deep-modules/NOTICE.md +2 -2
  404. package/ai/skills/stacks-setup-engineering/NOTICE.md +2 -2
  405. package/ai/skills/stacks-setup-engineering/PLAYBOOK.md +3 -1
  406. package/ai/skills/stacks-setup-engineering/issue-tracker-github.md +8 -4
  407. package/ai/skills/stacks-setup-engineering/issue-tracker-gitlab.md +3 -3
  408. package/ai/skills/stacks-software-factory/EXAMPLE-TASKS.md +80 -0
  409. package/ai/skills/stacks-software-factory/GIT-HOSTS.md +84 -0
  410. package/ai/skills/stacks-software-factory/LICENSE +21 -0
  411. package/ai/skills/stacks-software-factory/NOTICE.md +8 -0
  412. package/ai/skills/stacks-software-factory/OBSERVABILITY-PLATFORMS.md +75 -0
  413. package/ai/skills/stacks-software-factory/PLAYBOOK.md +95 -0
  414. package/ai/skills/stacks-software-factory/RUNNERS.md +94 -0
  415. package/ai/skills/stacks-software-factory/SKILL.md +21 -0
  416. package/ai/skills/stacks-software-factory/TICKET-TRACKERS.md +85 -0
  417. package/ai/skills/stacks-tdd/NOTICE.md +2 -2
  418. package/ai/skills/stacks-teach/NOTICE.md +2 -2
  419. package/ai/skills/stacks-test-fixtures/NOTICE.md +2 -2
  420. package/ai/skills/stacks-to-questionnaire/NOTICE.md +2 -2
  421. package/ai/skills/stacks-to-spec/NOTICE.md +2 -2
  422. package/ai/skills/stacks-to-tickets/NOTICE.md +2 -2
  423. package/ai/skills/stacks-triage/NOTICE.md +2 -2
  424. package/ai/skills/stacks-wait-what/NOTICE.md +2 -2
  425. package/ai/skills/stacks-wayfinder/NOTICE.md +2 -2
  426. package/ai/skills/stacks-wayfinder/PLAYBOOK.md +1 -1
  427. package/ai/skills/stacks-wizard/NOTICE.md +2 -2
  428. package/ai/skills/stacks-writing-beats/NOTICE.md +2 -2
  429. package/ai/skills/stacks-writing-for-agents/NOTICE.md +2 -2
  430. package/ai/skills/stacks-writing-for-agents/SKILL.md +1 -1
  431. package/ai/skills/stacks-writing-fragments/NOTICE.md +2 -2
  432. package/ai/skills/stacks-writing-shape/NOTICE.md +2 -2
  433. package/app/Actions/UnsubscribeAction.ts +1 -0
  434. package/ide/vscode/package.json +1 -1
  435. package/package.json +3 -3
@@ -0,0 +1,28 @@
1
+ <!-- Paste this into Acuity's Custom Conversion Tracking field (Integrations, then
2
+ Custom Conversion Tracking). Put your own website address in SITES below, or
3
+ nothing counts. Then install acuity-scheduling.js, or its GTM recipe, on your site. -->
4
+ <span hidden id="gtm-acuity-type">%appointmentType%</span>
5
+ <script>
6
+ (function () {
7
+ // Your website's address: https:// and the domain, nothing after it.
8
+ // Embedded on more than one site? Add each one: ['https://a.com', 'https://b.com']
9
+ var SITES = ['https://www.example.com'];
10
+ var id = '%id%', kind = '%type%', price = '%price%', el = document.getElementById('gtm-acuity-type');
11
+ function clean(v) {
12
+ v = String(v || '').replace(/^\s+|\s+$/g, '');
13
+ return v && !/^%[A-Za-z]+%$/.test(v) ? v : '';
14
+ }
15
+ id = clean(id);
16
+ if (!/^[A-Za-z0-9_-]{1,64}$/.test(id)) return;
17
+ var msg = { source: 'gtm-acuity-booking', version: 1, appointment_id: id };
18
+ kind = clean(kind);
19
+ if (/^[A-Za-z_-]{1,32}$/.test(kind)) msg.kind = kind;
20
+ var type = clean(el && el.textContent);
21
+ if (type) msg.appointment_type = type.slice(0, 200);
22
+ price = clean(price);
23
+ if (price) msg.price = price.slice(0, 32);
24
+ for (var i = 0; i < SITES.length; i++) {
25
+ try { window.top.postMessage(msg, SITES[i]); } catch (e) {}
26
+ }
27
+ })();
28
+ </script>
@@ -0,0 +1,75 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! Acuity Scheduling conversion detection (MIT)
4
+ * Detects: meeting booked. Pushes dataLayer event: acuity_appointment_scheduled
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ 'use strict';
8
+ if (window.__ctDetectAcuity) return;
9
+ window.__ctDetectAcuity = true;
10
+ window.dataLayer = window.dataLayer || [];
11
+
12
+ // Acuity's booking form gives the page no booking event of its own. This
13
+ // listener pairs with a short snippet the site owner pastes into Acuity's
14
+ // custom conversion tracking field (the field snippet that comes with this
15
+ // listener). Acuity runs that snippet after each booking inside its
16
+ // conversion tracking frame, on
17
+ // https://conversion-tracking-sandbox.acuityinnovation.com, two frames below
18
+ // this page, and it posts the booking's ID to this page only (it names the
19
+ // page's own address as the target). The frame is a grandchild, so it can't
20
+ // be matched to an iframe on the page; it must come from Acuity's origin and
21
+ // sit inside this page's own frame tree.
22
+ var ORIGIN_PATTERN = /^https:\/\/([a-z0-9-]+\.)+acuityinnovation\.com$/;
23
+ var ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
24
+ var KIND_PATTERN = /^[A-Za-z_-]{1,32}$/;
25
+ var PRICE_PATTERN = /^[0-9]{1,9}(\.[0-9]{1,4})?$/;
26
+ var seenIds = [];
27
+
28
+ function isPlainObject(value) {
29
+ return !!value && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Object]';
30
+ }
31
+
32
+ // A frame inside this page has this page as its top window. A popup or a
33
+ // window this page opened does not.
34
+ function insideThisPage(source) {
35
+ try { return source.top === window; } catch (e) { return false; }
36
+ }
37
+
38
+ function idSeen(id) {
39
+ for (var i = 0; i < seenIds.length; i++) if (seenIds[i] === id) return true;
40
+ return false;
41
+ }
42
+
43
+ function cleanText(value, max) {
44
+ if (typeof value !== 'string') return '';
45
+ value = value.replace(/[\u0000-\u001f\u007f]/g, ' ').replace(/^\s+|\s+$/g, '');
46
+ return value.length > max ? value.slice(0, max) : value;
47
+ }
48
+
49
+ function onMessage(message) {
50
+ if (!message || !message.source || message.source === window) return;
51
+ if (typeof message.origin !== 'string' || !ORIGIN_PATTERN.test(message.origin)) return;
52
+ if (!insideThisPage(message.source)) return;
53
+ var data = message.data;
54
+ if (!isPlainObject(data) || data.source !== 'gtm-acuity-booking' || data.version !== 1) return;
55
+ if (typeof data.appointment_id !== 'string' || !ID_PATTERN.test(data.appointment_id)) return;
56
+ if (idSeen(data.appointment_id)) return;
57
+ var push = { event: 'acuity_appointment_scheduled', appointment_id: data.appointment_id };
58
+ if (typeof data.kind === 'string' && KIND_PATTERN.test(data.kind)) push.acuity_type = data.kind;
59
+ var type = cleanText(data.appointment_type, 200);
60
+ if (type) push.appointment_type = type;
61
+ if (typeof data.price === 'string' && PRICE_PATTERN.test(data.price)) push.price = data.price;
62
+ // The ID is remembered only once the push went through, so a dataLayer
63
+ // that throws (a broken wrapper) never escapes into the page, and a
64
+ // repeat of the same message can still be counted.
65
+ try {
66
+ window.dataLayer = window.dataLayer || [];
67
+ window.dataLayer.push(push);
68
+ } catch (e) {
69
+ return;
70
+ }
71
+ seenIds.push(data.appointment_id);
72
+ }
73
+
74
+ window.addEventListener('message', onMessage, false);
75
+ })();
@@ -0,0 +1,134 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! Cal.com conversion detection (MIT)
4
+ * Detects: meeting booked. Pushes dataLayer event: calcom_booking_successful
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ 'use strict';
8
+ if (window.__ctDetectCalcom) return;
9
+ window.__ctDetectCalcom = true;
10
+ window.dataLayer = window.dataLayer || [];
11
+
12
+ // Cal.com's embed code (inline, popup and floating button) renders an iframe
13
+ // from https://app.cal.com; a booking page pasted in as a plain iframe loads
14
+ // from https://cal.com. Each posts from its own origin, so a frame is only
15
+ // trusted for the origin its address starts with. The CSS selectors do that
16
+ // prefix match so this listener never reads an iframe's address, because
17
+ // Cal.com prefill parameters can carry a name or email.
18
+ var CAL_FRAMES = [
19
+ { selector: 'iframe[src^="https://app.cal.com/"]', origin: 'https://app.cal.com' },
20
+ { selector: 'iframe[src^="https://cal.com/"]', origin: 'https://cal.com' }
21
+ ];
22
+ var UID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;
23
+ var STATUS_PATTERN = /^[A-Z_]{1,32}$/;
24
+ var trackedFrames = [];
25
+ var seenUids = [];
26
+
27
+ function trackFrame(frame, origin) {
28
+ if (!frame || !frame.contentWindow) return;
29
+ for (var i = 0; i < trackedFrames.length; i++) {
30
+ if (trackedFrames[i].frame === frame) {
31
+ trackedFrames[i].origin = origin;
32
+ return;
33
+ }
34
+ }
35
+ trackedFrames.push({ frame: frame, origin: origin });
36
+ }
37
+
38
+ function scan(root) {
39
+ if (!root || typeof root.querySelectorAll !== 'function') return;
40
+ for (var k = 0; k < CAL_FRAMES.length; k++) {
41
+ var frames;
42
+ try { frames = root.querySelectorAll(CAL_FRAMES[k].selector); } catch (e) { continue; }
43
+ for (var i = 0; i < frames.length; i++) trackFrame(frames[i], CAL_FRAMES[k].origin);
44
+ }
45
+ }
46
+
47
+ // The message must come from a Cal.com frame that is on this page right now,
48
+ // and from the origin that frame was loaded from. Cal.com re-creates popup
49
+ // frames, so a frame seen earlier is re-checked live.
50
+ function sourceIsTracked(message) {
51
+ for (var i = 0; i < trackedFrames.length; i++) {
52
+ var item = trackedFrames[i];
53
+ try {
54
+ if (item.frame.isConnected === true && item.frame.contentWindow === message.source && item.origin === message.origin) return true;
55
+ } catch (e) { /* replaced or inaccessible frames fail closed */ }
56
+ }
57
+ return false;
58
+ }
59
+
60
+ function isCalOrigin(origin) {
61
+ for (var k = 0; k < CAL_FRAMES.length; k++) if (CAL_FRAMES[k].origin === origin) return true;
62
+ return false;
63
+ }
64
+
65
+ function isPlainObject(value) {
66
+ return !!value && typeof value === 'object' && Object.prototype.toString.call(value) === '[object Object]';
67
+ }
68
+
69
+ function uidSeen(uid) {
70
+ for (var i = 0; i < seenUids.length; i++) if (seenUids[i] === uid) return true;
71
+ return false;
72
+ }
73
+
74
+ function onMessage(message) {
75
+ if (!message || !message.source || message.source === window) return;
76
+ if (!isCalOrigin(message.origin)) return;
77
+ // A frame added since the last scan (a popup that just opened) is picked up here.
78
+ if (!sourceIsTracked(message)) {
79
+ scan(document);
80
+ if (!sourceIsTracked(message)) return;
81
+ }
82
+ var data = message.data;
83
+ if (typeof data === 'string') {
84
+ try { data = JSON.parse(data); } catch (e) { return; }
85
+ }
86
+ // Only a completed new booking. Reschedules (rescheduleBookingSuccessfulV2)
87
+ // and the deprecated V1 events, which carry the attendee's details, never match.
88
+ if (!isPlainObject(data) || data.originator !== 'CAL' || data.type !== 'bookingSuccessfulV2') return;
89
+ var booking = data.data;
90
+ if (!isPlainObject(booking) || typeof booking.uid !== 'string' || !UID_PATTERN.test(booking.uid)) return;
91
+ if (uidSeen(booking.uid)) return;
92
+ // Only these three values are copied. The booking title names the attendee,
93
+ // so it and every other field are left behind.
94
+ var push = { event: 'calcom_booking_successful', booking_uid: booking.uid };
95
+ if (typeof booking.eventTypeId === 'number' && isFinite(booking.eventTypeId)) push.event_type_id = String(booking.eventTypeId);
96
+ if (typeof booking.status === 'string' && STATUS_PATTERN.test(booking.status)) push.booking_status = booking.status;
97
+ // The ID is remembered only once the push went through, so a dataLayer
98
+ // that throws (a broken wrapper) never escapes into the page, and a
99
+ // repeat of the same message can still be counted.
100
+ try {
101
+ window.dataLayer = window.dataLayer || [];
102
+ window.dataLayer.push(push);
103
+ } catch (e) {
104
+ return;
105
+ }
106
+ seenUids.push(booking.uid);
107
+ }
108
+
109
+ function start() {
110
+ if (typeof document === 'undefined') return;
111
+ scan(document);
112
+ if (typeof MutationObserver === 'undefined' || !document.documentElement) return;
113
+ try {
114
+ var observer = new MutationObserver(function (mutations) {
115
+ for (var i = 0; i < mutations.length; i++) {
116
+ var added = mutations[i].addedNodes || [];
117
+ for (var j = 0; j < added.length; j++) {
118
+ var node = added[j];
119
+ if (node && node.tagName === 'IFRAME') scan(document);
120
+ else scan(node);
121
+ }
122
+ if (mutations[i].type === 'attributes' && mutations[i].attributeName === 'src') scan(document);
123
+ }
124
+ });
125
+ observer.observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['src'] });
126
+ } catch (e) {}
127
+ }
128
+
129
+ if (typeof document !== 'undefined') {
130
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, false);
131
+ else start();
132
+ }
133
+ window.addEventListener('message', onMessage, false);
134
+ })();
@@ -0,0 +1,113 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! Calendly conversion detection (MIT)
4
+ * Detects: meeting booked. Pushes dataLayer event: calendly_event_scheduled
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ 'use strict';
8
+ if (window.__ctDetectCalendly) return;
9
+ window.__ctDetectCalendly = true;
10
+ window.dataLayer = window.dataLayer || [];
11
+
12
+ // The CSS selector matches only Calendly's documented exact embed host.
13
+ // Do not read iframe.src or its `src` attribute: prefill parameters can
14
+ // contain invitee PII. The selector engine performs the prefix match without
15
+ // exposing the URL value to this listener.
16
+ var CALENDLY_FRAME_SELECTOR = 'iframe[src^=\"https://calendly.com/\"]';
17
+ var CALENDLY_ORIGIN = 'https://calendly.com';
18
+ var API_HOSTS = { 'api.calendly.com': true, 'calendly.com': true };
19
+ var trackedFrames = [];
20
+ var seenPairs = [];
21
+
22
+ function trackFrame(frame) {
23
+ if (!frame || !frame.contentWindow) return;
24
+ for (var i = 0; i < trackedFrames.length; i++) {
25
+ if (trackedFrames[i].frame === frame) {
26
+ trackedFrames[i].source = frame.contentWindow;
27
+ trackedFrames[i].origin = CALENDLY_ORIGIN;
28
+ return;
29
+ }
30
+ }
31
+ trackedFrames.push({ frame: frame, source: frame.contentWindow, origin: CALENDLY_ORIGIN });
32
+ }
33
+
34
+ function scan(root) {
35
+ if (!root || typeof root.querySelectorAll !== 'function') return;
36
+ var frames;
37
+ try { frames = root.querySelectorAll(CALENDLY_FRAME_SELECTOR); } catch (e) { return; }
38
+ for (var i = 0; i < frames.length; i++) trackFrame(frames[i]);
39
+ }
40
+
41
+ function sourceIsTracked(event) {
42
+ for (var i = 0; i < trackedFrames.length; i++) {
43
+ var item = trackedFrames[i];
44
+ try {
45
+ if (item.frame.isConnected === true && item.frame.contentWindow === event.source && item.source === event.source && item.origin === event.origin) return true;
46
+ } catch (e) { /* replaced or inaccessible frames fail closed */ }
47
+ }
48
+ return false;
49
+ }
50
+
51
+ function resourceIdentity(value, kind) {
52
+ if (typeof value !== 'string' || /[?#]/.test(value)) return null;
53
+ try {
54
+ var url = new URL(value);
55
+ if (url.protocol !== 'https:' || url.port || !API_HOSTS[url.hostname]) return null;
56
+ var eventMatch = /(?:^|\/)scheduled_events\/([A-Za-z0-9_-]{1,128})\/?$/.exec(url.pathname);
57
+ var inviteeMatch = /(?:^|\/)scheduled_events\/([A-Za-z0-9_-]{1,128})\/invitees\/([A-Za-z0-9_-]{1,128})\/?$/.exec(url.pathname);
58
+ if (kind === 'event' && eventMatch) return { eventId: eventMatch[1].toLowerCase() };
59
+ if (kind === 'invitee' && inviteeMatch) return { eventId: inviteeMatch[1].toLowerCase(), inviteeId: inviteeMatch[2].toLowerCase() };
60
+ } catch (e) { return null; }
61
+ return null;
62
+ }
63
+
64
+ function pairSeen(eventId, inviteeId) {
65
+ var key = eventId + ':' + inviteeId;
66
+ for (var i = 0; i < seenPairs.length; i++) if (seenPairs[i] === key) return true;
67
+ seenPairs.push(key);
68
+ return false;
69
+ }
70
+
71
+ function onMessage(message) {
72
+ if (!message || !message.source || message.source === window || !sourceIsTracked(message)) return;
73
+ var data = message.data;
74
+ if (typeof data === 'string') {
75
+ try { data = JSON.parse(data); } catch (e) { return; }
76
+ }
77
+ if (!data || typeof data !== 'object' || data.event !== 'calendly.event_scheduled') return;
78
+ var payload = data.payload || {};
79
+ var eventUri = payload.event && payload.event.uri;
80
+ var inviteeUri = payload.invitee && payload.invitee.uri;
81
+ var eventIdentity = resourceIdentity(eventUri, 'event');
82
+ var inviteeIdentity = resourceIdentity(inviteeUri, 'invitee');
83
+ if (!eventIdentity || !inviteeIdentity || eventIdentity.eventId !== inviteeIdentity.eventId) return;
84
+ if (pairSeen(eventIdentity.eventId, inviteeIdentity.inviteeId)) return;
85
+ window.dataLayer.push({ event: 'calendly_event_scheduled', event_uri: eventUri, invitee_uri: inviteeUri });
86
+ }
87
+
88
+ function start() {
89
+ if (typeof document === 'undefined') return;
90
+ scan(document);
91
+ if (typeof MutationObserver === 'undefined' || !document.documentElement) return;
92
+ try {
93
+ var observer = new MutationObserver(function (mutations) {
94
+ for (var i = 0; i < mutations.length; i++) {
95
+ var added = mutations[i].addedNodes || [];
96
+ for (var j = 0; j < added.length; j++) {
97
+ var node = added[j];
98
+ if (node && node.tagName === 'IFRAME') scan(document);
99
+ else scan(node);
100
+ }
101
+ if (mutations[i].type === 'attributes' && mutations[i].attributeName === 'src') scan(document);
102
+ }
103
+ });
104
+ observer.observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['src'] });
105
+ } catch (e) {}
106
+ }
107
+
108
+ if (typeof document !== 'undefined') {
109
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, false);
110
+ else start();
111
+ }
112
+ window.addEventListener('message', onMessage, false);
113
+ })();
@@ -0,0 +1,101 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! Contact Form 7 conversion detection (MIT)
4
+ * Detects: form submission. Pushes dataLayer event: contact_form_7_submitted
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ 'use strict';
8
+
9
+ // One shared runtime owns eligibility, accepted event identity, and the ID-only fallback.
10
+ // A legacy recipe guard without this runtime is unknown code, so do not stack a new listener.
11
+ var runtime = window.__ctCf7Runtime;
12
+ if (runtime && runtime.installed) return;
13
+ if (!runtime && window.__ctDetectContactForm7) return;
14
+ runtime = runtime || { installed: false };
15
+ window.__ctCf7Runtime = runtime;
16
+ window.__ctDetectContactForm7 = true;
17
+ window.dataLayer = window.dataLayer || [];
18
+ var seenEvents = typeof WeakSet === 'function' ? new WeakSet() : null;
19
+ var seenEventFallback = [];
20
+
21
+ function isContactForm7Form(formEl) {
22
+ if (!formEl || (formEl.tagName || '').toLowerCase() !== 'form') return false;
23
+ try {
24
+ if (formEl.classList && formEl.classList.contains('wpcf7-form')) return true;
25
+ return !!(formEl.closest && formEl.closest('.wpcf7'));
26
+ } catch (e) {
27
+ return false;
28
+ }
29
+ }
30
+
31
+ function validFormId(value) {
32
+ if (typeof value === 'number' && Number.isFinite(value) && Math.floor(value) === value && value > 0 && value <= 9007199254740991) return String(value);
33
+ if (typeof value !== 'string' || !/^[1-9]\d*$/.test(value)) return '';
34
+ var number = Number(value);
35
+ return Number.isFinite(number) && number <= 9007199254740991 && String(number) === value ? value : '';
36
+ }
37
+
38
+ function readFormId(formEl, event) {
39
+ // CF7 6.1.6's event detail has contactFormId; read no other detail keys.
40
+ var detailId = '';
41
+ try {
42
+ detailId = validFormId(event && event.detail && event.detail.contactFormId);
43
+ } catch (e) {}
44
+ if (detailId) return detailId;
45
+
46
+ // Compatibility fallback for markup where the event detail omits the ID.
47
+ try {
48
+ var directId = validFormId(formEl.getAttribute && formEl.getAttribute('data-wpcf7-id'));
49
+ if (directId) return directId;
50
+ var wrap = formEl.closest && formEl.closest('.wpcf7');
51
+ return validFormId(wrap && wrap.getAttribute && wrap.getAttribute('data-wpcf7-id'));
52
+ } catch (e) {
53
+ return '';
54
+ }
55
+ }
56
+
57
+ // CF7 can send both clicks while the first request is still pending.
58
+ // Group those requests without blocking or changing the form submission.
59
+ document.addEventListener('wpcf7beforesubmit', function (event) {
60
+ var formEl = event && event.target;
61
+ if (!isContactForm7Form(formEl)) return;
62
+ if (!formEl.__ctCf7Attempt || formEl.getAttribute('data-status') !== 'submitting') {
63
+ formEl.__ctCf7Attempt = { emitted: false };
64
+ }
65
+ }, false);
66
+
67
+ document.addEventListener('wpcf7mailsent', function (event) {
68
+ var formEl = event && event.target;
69
+ if (!isContactForm7Form(formEl)) return;
70
+ if (seenEvents) {
71
+ if (seenEvents.has(event)) return;
72
+ seenEvents.add(event);
73
+ } else {
74
+ if (seenEventFallback.indexOf(event) !== -1) return;
75
+ seenEventFallback.push(event);
76
+ if (seenEventFallback.length > 50) seenEventFallback.shift();
77
+ }
78
+
79
+ var formId = readFormId(formEl, event);
80
+ if (!formId) return;
81
+ var attempt = formEl.__ctCf7Attempt;
82
+ if (attempt && attempt.emitted) return;
83
+ if (attempt) attempt.emitted = true;
84
+
85
+ // The optional Method 2 adapter may enrich this accepted event. It must
86
+ // return literal true only after pushing; otherwise the shared core emits
87
+ // the same event with IDs only. Neither path inspects event.detail values.
88
+ var enriched = false;
89
+ try {
90
+ if (typeof window.__ctCf7Method2Emit === 'function') {
91
+ enriched = window.__ctCf7Method2Emit(formEl, event, formId) === true;
92
+ }
93
+ } catch (e) {
94
+ enriched = false;
95
+ }
96
+ if (!enriched) {
97
+ window.dataLayer.push({ event: 'contact_form_7_submitted', form_id: formId });
98
+ }
99
+ }, false);
100
+ runtime.installed = true;
101
+ })();
@@ -0,0 +1,54 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! Divi Forms conversion detection (MIT)
4
+ * Detects: form submission. Pushes dataLayer event: divi_form_submitted
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ if (window.__ctDetectDiviForms) return;
8
+ window.__ctDetectDiviForms = true;
9
+ window.dataLayer = window.dataLayer || [];
10
+ var reported = typeof WeakSet === 'function' ? new WeakSet() : null;
11
+ function inspect(container) {
12
+ if (!container || !container.querySelector) return;
13
+ var notice;
14
+ try {
15
+ notice = container.querySelector('.et-pb-contact-message.et_pb_success_message');
16
+ if (!notice || container.querySelector('form.et_pb_contact_form') ||
17
+ container.querySelector('.et_pb_contact_error_meesage') ||
18
+ container.querySelector('.et_contact_error')) return;
19
+ } catch (e) { return; }
20
+ if (reported && reported.has(notice)) return;
21
+ if (reported) reported.add(notice);
22
+ var id = container.id || (container.getAttribute && container.getAttribute('data-id')) || '';
23
+ if (!id) return;
24
+ var adapter = window.__ctDiviMethod2Emit;
25
+ if (typeof adapter === 'function' && adapter(container, String(id)) === true) return;
26
+ window.dataLayer.push({ event: 'divi_form_submitted', form_id: String(id) });
27
+ }
28
+ function observe(container) {
29
+ if (!container || container.__ctDiviObserved || typeof MutationObserver === 'undefined') return;
30
+ container.__ctDiviObserved = true;
31
+ new MutationObserver(function () { inspect(container); }).observe(container,
32
+ { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });
33
+ inspect(container);
34
+ }
35
+ function start() {
36
+ var existing = document.querySelectorAll('.et_pb_contact_form_container');
37
+ for (var i = 0; i < existing.length; i++) observe(existing[i]);
38
+ if (typeof MutationObserver !== 'undefined' && document.documentElement) {
39
+ new MutationObserver(function (records) {
40
+ for (var r = 0; r < records.length; r++) {
41
+ for (var n = 0; n < records[r].addedNodes.length; n++) {
42
+ var node = records[r].addedNodes[n];
43
+ if (node.nodeType !== 1) continue;
44
+ if (node.matches && node.matches('.et_pb_contact_form_container')) observe(node);
45
+ var nested = node.querySelectorAll ? node.querySelectorAll('.et_pb_contact_form_container') : [];
46
+ for (var j = 0; j < nested.length; j++) observe(nested[j]);
47
+ }
48
+ }
49
+ }).observe(document.documentElement, { childList: true, subtree: true });
50
+ }
51
+ }
52
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });
53
+ else start();
54
+ })();
@@ -0,0 +1,54 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! Elementor Forms conversion detection (MIT)
4
+ * Detects: form submission. Pushes dataLayer event: elementor_form_submitted
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ if (window.__ctDetectElementorForms) return;
8
+ window.__ctDetectElementorForms = true;
9
+ window.dataLayer = window.dataLayer || [];
10
+ var seenEvents = typeof WeakSet === 'function' ? new WeakSet() : null;
11
+ function formFrom(target) {
12
+ try {
13
+ if (!target || target === document || target === window) return null;
14
+ if (target.matches && target.matches('form.elementor-form')) return target;
15
+ return target.closest ? target.closest('form.elementor-form') : null;
16
+ } catch (e) { return null; }
17
+ }
18
+ function formId(form) {
19
+ if (!form) return '';
20
+ if (form.id) return form.id;
21
+ var name = form.getAttribute && form.getAttribute('name');
22
+ if (name && name !== 'New Form') return name;
23
+ var widget = form.closest && form.closest('[data-id]');
24
+ return widget && widget.getAttribute('data-id') || '';
25
+ }
26
+ function onSuccess(event) {
27
+ if (event && seenEvents) {
28
+ if (seenEvents.has(event)) return;
29
+ seenEvents.add(event);
30
+ }
31
+ var form = formFrom(event && event.target);
32
+ var id = formId(form);
33
+ if (!form || !id) return;
34
+ var adapter = window.__ctElementorMethod2Emit;
35
+ if (typeof adapter === 'function') {
36
+ try { if (adapter(form, id) === true) return; }
37
+ catch (e) { return; }
38
+ }
39
+ window.dataLayer.push({ event: 'elementor_form_submitted', form_id: String(id) });
40
+ }
41
+ var handlerBound = false;
42
+ function hook() {
43
+ if (handlerBound) return true;
44
+ var jq = typeof jQuery !== 'undefined' ? jQuery : (typeof $ !== 'undefined' ? $ : null);
45
+ if (!jq) return false;
46
+ jq(document).on('submit_success', onSuccess);
47
+ handlerBound = true;
48
+ return true;
49
+ }
50
+ if (!hook()) {
51
+ document.addEventListener('DOMContentLoaded', hook, { once: true });
52
+ window.addEventListener('load', hook, { once: true });
53
+ }
54
+ })();
@@ -0,0 +1,96 @@
1
+ // Upstream GTM Custom HTML asset: retain ES5 syntax and callback signatures.
2
+ /* eslint-disable prefer-const, pickier/no-unused-vars */
3
+ /*! File download conversion detection (MIT)
4
+ * Detects: click on a downloadable file link. Pushes dataLayer event: file_download
5
+ * From the conversion-tracking skill in Marketing Skills */
6
+ (function () {
7
+ if (window.__ctDetectFileDownload) return;
8
+ window.__ctDetectFileDownload = true;
9
+ window.dataLayer = window.dataLayer || [];
10
+
11
+ /* For gated content that is NOT gated: price lists, brochures, spec
12
+ sheets, lead magnets served as a direct link. If the download sits
13
+ behind a form, track the form instead — that is where the lead is.
14
+
15
+ GA4 already collects file_download as an enhanced measurement event.
16
+ Use this when you need the same signal in Google Ads or Meta, which
17
+ do not. */
18
+
19
+ // EDIT if you serve other formats.
20
+ var EXTENSIONS = [
21
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
22
+ 'csv', 'zip', 'rar', '7z', 'dmg', 'exe', 'pkg',
23
+ 'mp3', 'mp4', 'mov', 'wav', 'txt', 'rtf'
24
+ ];
25
+
26
+ var DEDUPE_MS = 2000;
27
+ var lastUrl = null;
28
+ var lastAt = 0;
29
+
30
+ function extensionOf(url) {
31
+ try {
32
+ // Strip query and hash before reading the extension, so
33
+ // /brochure.pdf?utm_source=x still resolves to "pdf".
34
+ var path = String(url || '').split('#')[0].split('?')[0];
35
+ var name = path.substring(path.lastIndexOf('/') + 1);
36
+ var dot = name.lastIndexOf('.');
37
+ if (dot < 0) return null;
38
+ var ext = name.substring(dot + 1).toLowerCase();
39
+ for (var i = 0; i < EXTENSIONS.length; i++) {
40
+ if (EXTENSIONS[i] === ext) return ext;
41
+ }
42
+ } catch (e) { /* fall through */ }
43
+ return null;
44
+ }
45
+
46
+ function fileNameOf(url) {
47
+ try {
48
+ var path = String(url || '').split('#')[0].split('?')[0];
49
+ return decodeURIComponent(path.substring(path.lastIndexOf('/') + 1));
50
+ } catch (e) {
51
+ return '';
52
+ }
53
+ }
54
+
55
+ function handleClick(event) {
56
+ try {
57
+ if (event.button !== undefined && event.button !== 0) return;
58
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
59
+
60
+ var target = event.target;
61
+ if (!target || !target.closest) return;
62
+
63
+ var link = target.closest('a[href]');
64
+ if (!link) return;
65
+
66
+ // Resolve relative hrefs against the current page. .href does this for
67
+ // us where available; getAttribute would leave "/files/x.pdf" relative.
68
+ var url = link.href || link.getAttribute('href');
69
+ if (!url) return;
70
+
71
+ // An anchor carrying the download attribute is a download regardless
72
+ // of extension, so honour that too.
73
+ var ext = extensionOf(url);
74
+ var forced = link.hasAttribute && link.hasAttribute('download');
75
+ if (!ext && !forced) return;
76
+
77
+ var now = new Date().getTime();
78
+ if (url === lastUrl && (now - lastAt) < DEDUPE_MS) return;
79
+ lastUrl = url;
80
+ lastAt = now;
81
+
82
+ window.dataLayer.push({
83
+ event: 'file_download',
84
+ file_name: fileNameOf(url),
85
+ file_extension: ext || '',
86
+ file_url: url,
87
+ link_text: (link.textContent || '').trim().slice(0, 100),
88
+ page_path: window.location.pathname
89
+ });
90
+ } catch (e) {
91
+ // Never throw back into the page's own click handling.
92
+ }
93
+ }
94
+
95
+ document.addEventListener('click', handleClick, false);
96
+ })();