تخطَّ إلى المحتوى

Installation

Add the GetIntent script to your website and start personalizing content without a developer. The script is about 46 KB uncompressed and 12 KB gzipped (measured on 25 October 2026 from the script served at https://getintent.co/pixel.js).

Basic Installation

Paste the snippet from Dashboard > Install just before the closing </head> tag on every page you want to personalize. It looks like this, with your own site ID:

<style>.gi-af body{opacity:0!important}</style>
<script>(function(d,w,c,t){if(!/[?&](?:utm_[a-z]+|gi_(?:ad|kw|agid|cid|intent|signal)|intent|signal)=[^&]/i.test(w.location.search))return;var h=d.documentElement;h.classList.add(c);var r=w.getintentReveal=function(){h.classList.remove(c)};setTimeout(r,t)})(document,window,"gi-af",800)</script>
<script src="https://getintent.co/pixel.js" data-site-id="YOUR_SITE_ID" async></script>

The first two lines are an optional guard (on by default in the dashboard): on visits with campaign parameters it hides the page until the personalized copy is in place, for at most 800 ms. Visits without campaign parameters are never delayed. Instead of data-site-id you can authenticate with the site's publishable key in data-api-key.

Script Attributes

AttributeRequiredDescription
data-api-keyYesThe site's publishable key, starting with gi_pk_. Never use a secret gi_sk_ key in a page
data-site-idYesYour unique site identifier from the dashboard
data-debugNoSet to "true" to enable console logging for troubleshooting

Custom Parameters

You can pass custom data to GetIntent in two ways. Custom parameters are available in your analytics and can influence personalization logic.

Via HTML attributes

Add data-custom-* attributes directly on the script tag:

<script
  src="https://getintent.co/api/pixel"
  data-api-key="gi_pk_xxxx"
  data-site-id="YOUR_SITE_ID"
  data-custom-industry="saas"
  async
></script>

Via JavaScript

Define a global config object before the script loads:

<script>
  window.getintentConfig = {
    customParams: {
      industry: "saas",
      plan: "enterprise"
    }
  }
</script>

Protected Elements

GetIntent automatically protects common third-party widgets from being personalized. This prevents the pixel from accidentally rewriting cookie banners, chat bubbles, or other overlays that should remain untouched.

CategoryDefaultWhat it protects
Cookie bannersOnCookie consent popups and GDPR/CCPA banners
Chat widgetsOnLive chat, help desk, and support widgets (Intercom, Drift, Crisp, etc.)
Notification barsOnTop/bottom notification banners, announcement bars, promo strips
Fixed overlaysOnAny element with position: fixed or position: sticky

You can toggle each category independently in Dashboard > Selectors.

Platform-Specific Instructions

WordPress

Option A: Edit your theme's header.php file and paste the snippet just before the closing </head> tag.

Option B: Install the free WPCode plugin (formerly "Insert Headers and Footers"). Go to Code Snippets > Header & Footer, paste the snippet in the "Header" field and save. Checked with WPCode Lite 2.4.2 on WordPress 7.1 on 22 November 2026.

Webflow

Go to Site settings > Custom code > Head code. Paste the snippet, save and publish your site. Full Webflow guide (staging domains, CMS pages, Localization, interactions).

Shopify

Go to Online Store > Themes > Edit Code > theme.liquid. Paste the snippet just before the closing </head> tag.

Next.js / React

Use the Next.js Script component in your root layout or page:

import Script from 'next/script'

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <Script
          src="https://getintent.co/api/pixel"
          data-api-key="gi_pk_xxxx"
          data-site-id="YOUR_SITE_ID"
          strategy="afterInteractive"
        />
      </body>
    </html>
  )
}

Custom HTML

Paste the script tag directly before the closing </body> tag in your HTML file. No build tools or framework required.

Custom Domain (Optional)

Serve the GetIntent script from your own domain for better ad-blocker resistance and first-party context.

  1. Go to Settings > Domains in the dashboard.
  2. Add a CNAME record on your DNS provider pointing your chosen subdomain (e.g. t.yourdomain.com) to proxy.getintent.co.
  3. Return to the dashboard and click Verify. Once the DNS propagates, the status will change to active.
  4. An SSL certificate is provisioned automatically. Your script will now load from your own domain.

Verifying Installation

There are three ways to confirm the script is working correctly:

1. Debug attribute

Add data-debug="true" to your script tag. This enables verbose logging in the browser console so you can see every step of the personalization process.

2. Browser console

Open your browser's developer tools and check the Console tab. With debug mode enabled, look for messages prefixed with [GetIntent] — you'll see logs like “Content ready after X attempts” and “Scraped X elements”.

3. Dashboard check

Go to Dashboard > Install. It shows whether the script has been detected on your site and displays the last time a ping was received.