Jump to content

MarcLee0807

Member
  • Posts

    1
  • Joined

  • Last visited

Everything posted by MarcLee0807

  1. This code works for me just fine. Anyone who is struggling with adding Hubspot CTAs 'Trigger on button click' code snippet to external pages. Look up this code. My snippet was 'hs-cta-trigger-button hs-cta-trigger-button-117565208857', and I put them like '.add ('hs-cta-trigger-button', 'hs-cta-trigger-button-117565208857'). Other than that, I only entered block ID without # as the instruction explained. Below is my code. I hope it helps. <script> const buttonBlockId = 'block-9fe7a9eb09a9282784ff'; window.addEventListener ( 'DOMContentLoaded', ( ) => { document.querySelector ( '#' + buttonBlockId + ' a' ) .classList .add ( 'hs-cta-trigger-button', 'hs-cta-trigger-button-117565208857') } ); </script>
×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.