For AI agents: the complete documentation index is available at https://docs.clickmax.io/en/llms.txt, the full documentation bundle is available at https://docs.clickmax.io/en/llms-full.txt, and this page is available as Markdown at https://docs.clickmax.io/en/reference/browser-sdk/index.md.
  • English
  • Introduction

    The Clickmax Browser SDK is the script that connects your external page to Clickmax.

    It handles three main jobs:

    • capturing leads
    • recording page events
    • taking the visitor to the next step of the funnel

    Installation

    1. create an external page in Clickmax
    2. add that page to your funnel
    3. paste the script below inside the <head> of the page's HTML
    index.html
    <!DOCTYPE html>
    <html>
      <head>
        <!-- Start of Clickmax SDK Code -->
        <script>
        (()=>{let e="YOUR_PROJECT_SLUG",c="YOUR_PAGE_PATH",t=window;if(!t.cxs){function s(e,...c){t._cx?t._cx.callMethod.apply(t._cx,[e,...c]):t.cxs.queue.push([e,...c])}s.queue=[],t.cxs=s;{let t=encodeURIComponent,s=document,n=`https://api.clickmax.io/sdk/script.js?ps=${t(e)}&pg=${t(c)}`,i="script",p=s.createElement(i);p.async=!0,p.src=n;let o=s.getElementsByTagName(i)[0];o.parentNode.insertBefore(p,o)}}cxs("init",e,c)})();
        cxs('track', 'page_view');
        </script>
        <noscript><img height="1" width="1" style="display: none" src="https://api.clickmax.io/tr/YOUR_PROJECT_SLUG?ty=page_view&pg=YOUR_PAGE_PATH&pl=%7B%22noscript%22%3A1%7D"/></noscript>
        <!-- End of Clickmax SDK Code -->
      </head>
    
      <body>
        <!-- Conteudo da pagina -->
      </body>
    </html>

    How it works

    Once the script is installed, the page starts recognising the elements marked with the Clickmax attributes.

    Common examples:

    • a form with data-cx-ingest-form
    • a widget with data-cx-form-widget
    • a button with data-cx-open

    When the visitor interacts with those elements, the SDK:

    1. collects the data it needs
    2. sends that information to Clickmax
    3. applies the rules of the configured funnel

    That saves you writing a separate integration for every form, click or redirect.

    When to use each section

    API

    Use this when you want to see the public way of calling the SDK with JavaScript.

    Forms

    Use this when you want to install or customise forms.

    Tracking

    Use this when you want to measure behaviour on the page.

    Routing

    Use this when you want to understand how the visitor moves on to the next step of the funnel.