Checkpoint Docs

Marketing Pixel

No-code AI agent detection for marketing teams using Google Tag Manager

Overview

The Checkpoint Marketing Pixel is a no-code solution for detecting AI agents and bots on your website. It integrates with Google Tag Manager (GTM) and other tag management systems, requiring no developer involvement.

For a technical overview of the Pixel's detection capabilities and how it compares to other detection methods, see Detection Methods.

Why Use the Marketing Pixel?

For Marketing Teams

  • No coding required — Install through GTM interface
  • Quick deployment — Live in minutes
  • Easy configuration — Visual interface for settings
  • A/B testing ready — Test different responses

Analytics Integration

  • Google Analytics 4 — Automatic event tracking
  • Custom dimensions — Rich agent detection data
  • Audience building — Segment real users from bots
  • Conversion tracking — Accurate conversion metrics

Bot Protection

  • Ad fraud prevention — Block fake ad clicks
  • Form spam protection — Stop automated submissions
  • Content scraping — Protect your content
  • Inventory protection — Hide pricing from competitors

Installation Methods

GTM Installation

Step 1: Import the Template

  1. Log into Google Tag Manager
  2. Navigate to TemplatesTag Templates
  3. Click Search Gallery
  4. Search for "Checkpoint" (or "AgentShield")
  5. Click Add to Workspace
  6. Click Add to confirm

If the template isn't in the gallery yet, you can import it manually from our GitHub repository. Download the template.tpl file and import it using GTM's template import feature.

Manual Template Import (Alternative)

If you can't find the template in the gallery:

  1. Visit our GitHub repository
  2. Download the template.tpl file
  3. In GTM, go to TemplatesTag TemplatesNew
  4. Click the menu → Import
  5. Select the downloaded template.tpl file
  6. Click Save

Step 2: Create the Tag

  1. Go to TagsNew
  2. Click Tag Configuration
  3. Select Checkpoint Pixel from Custom templates
  4. Configure:
    • Project ID: Enter your Project ID from the dashboard
    • Debug Mode: Enable for testing

Step 3: Set Triggers

  1. Click Triggering
  2. For Single Page Applications (SPAs):
    • Create a History Change trigger (for React, Vue, Angular)
    • Go to Triggers → New → Trigger Configuration
    • Select History Change as trigger type
    • Name it "All History Changes"
    • Apply this trigger to your Checkpoint tag
  3. For Traditional websites:
    • Select All Pages trigger
  4. Optional: Add custom triggers for specific events

SPA Tracking Note: The Checkpoint pixel automatically detects and tracks SPA navigation events including:

  • History API changes (pushState/replaceState)
  • Browser back/forward navigation (popstate)
  • Hash changes (hashchange)

However, configuring GTM's History Change trigger ensures redundancy and allows you to track additional GTM variables with each navigation.

Step 4: Test & Publish

  1. Click Preview to test in debug mode
  2. Verify the pixel fires correctly
  3. Check detection events in preview
  4. Click Submit to publish
  5. Add version notes and Publish

Direct JavaScript Installation

Add this code to your website's <head> or before the closing </body> tag:

<!-- Checkpoint Pixel -->
<script
  src="https://kya.vouched.id/pixel.js"
  data-project-id="YOUR_PROJECT_ID"
  data-debug="false">
</script>

Replace YOUR_PROJECT_ID with your actual Project ID from the Checkpoint dashboard.

What the pixel does automatically:

  • Automatic detection — Identifies AI agents and bots on every pageview
  • SPA tracking — Detects navigation in React, Vue, Angular apps
  • Session persistence — Maintains session across page reloads
  • User identification — Ready for window.AgentShield.identify() calls
  • Debug mode — Set data-debug="true" to see detailed console logs

Configuration Options

The pixel script accepts configuration via data attributes or query parameters:

Method 1: Data Attribute (Recommended)

<script
  src="https://kya.vouched.id/pixel.js"
  data-project-id="YOUR_PROJECT_ID">
</script>

Method 2: Query Parameter (For Shopify ScriptTag API)

<script src="https://kya.vouched.id/pixel.js?project-id=YOUR_PROJECT_ID"></script>
AttributeDescriptionDefault
data-project-idYour Checkpoint Project ID (preferred method)
Query param ?project-id=Alternative: Project ID as URL query parameter
data-debugEnable debug console loggingfalse
data-session-timeoutSession timeout in milliseconds1800000 (30 min)
data-respect-dntHonor Do Not Track browser settingtrue
data-enable-fingerprintingEnable browser fingerprintingtrue

Verifying Installation

Open your browser's Developer Tools console:

// Check if the pixel is loaded
console.log('Pixel loaded:', typeof window.AgentShield !== 'undefined');

// Get initialization info
console.log(window.AgentShield?.getInitInfo());

// Expected output:
// {
//   version: "1.1.0",
//   initialized: true,
//   sessionId: "abc-123...",
//   projectId: "YOUR_PROJECT_ID"
// }

If you see initialized: true, the pixel is working correctly.

Next.js Installation

Content Security Policy (CSP) Configuration

If you have CSP headers configured, you must allowlist the Checkpoint domain or the pixel will be blocked.

Required CSP Directives:

  • script-src: Must include https://kya.vouched.id
  • connect-src: Must include https://kya.vouched.id
// next.config.js
module.exports = {
  async headers() {
    return [
      {
        source: '/:path*',
        headers: [
          {
            key: 'Content-Security-Policy',
            value: [
              "default-src 'self'",
              "script-src 'self' 'unsafe-inline' https://kya.vouched.id",
              "connect-src 'self' https://kya.vouched.id",
              // ... your other CSP directives
            ].join('; ')
          }
        ]
      }
    ]
  }
}

Only add https://kya.vouched.id to your existing CSP directives. Don't replace your entire CSP policy with this example.

Adding the Pixel

Use Next.js's <Script> component with strategy="afterInteractive":

App Router (app/layout.tsx)

import Script from 'next/script';

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <body>
        <Script
          src="https://kya.vouched.id/pixel.js"
          data-project-id={process.env.NEXT_PUBLIC_CHECKPOINT_PROJECT_ID}
          strategy="afterInteractive"
        />
        {children}
      </body>
    </html>
  );
}

Pages Router (_app.tsx)

import Script from 'next/script';
import type { AppProps } from 'next/app';

export default function App({ Component, pageProps }: AppProps) {
  return (
    <>
      <Script
        src="https://kya.vouched.id/pixel.js"
        data-project-id={process.env.NEXT_PUBLIC_CHECKPOINT_PROJECT_ID}
        strategy="afterInteractive"
      />
      <Component {...pageProps} />
    </>
  );
}

For server-side detection in Next.js, use the Middleware instead. The Pixel is client-side only.

Adobe Launch Installation

Step 1: Create Data Element

  1. Go to Data ElementsAdd Data Element
  2. Name: "Checkpoint Project ID"
  3. Extension: Core
  4. Data Element Type: Custom Code
  5. Code:
    return 'YOUR_PROJECT_ID';

Step 2: Create Rule

  1. Go to RulesAdd Rule
  2. Name: "Checkpoint Detection"
  3. Events: Add "Page Bottom" or "DOM Ready"
  4. Actions: Add Action
    • Extension: Core
    • Action Type: Custom Code

Step 3: Add Pixel Code

var script = document.createElement('script');
script.src = 'https://kya.vouched.id/pixel.js';
script.setAttribute('data-project-id', _satellite.getVar('Checkpoint Project ID'));
document.head.appendChild(script);

Step 4: Publish

  1. Save the rule
  2. Build for Development
  3. Test in staging
  4. Build for Production

Google Analytics 4 Integration

Automatic Event Tracking

The pixel automatically sends events to GA4 when configured:

// Events sent to GA4
gtag('event', 'checkpoint_detection', {
  detection_class: 'ai_agent',
  confidence: 85,
  agent_name: 'ChatGPT',
});

Custom Dimensions Setup

  1. In GA4, go to ConfigureCustom Definitions
  2. Create custom dimensions:
    • detection_class (Text)
    • confidence (Number)
    • agent_name (Text)

Audience Creation

  1. Go to ConfigureAudiences
  2. Create "Real Users" audience:
    • Condition: detection_class = human
  3. Create "Detected Agents" audience:
    • Condition: detection_class = ai_agent

JavaScript API Reference

The pixel exposes a window.AgentShield object with methods for user identification and session management.

Available Methods

// Identify a user (for user tracking)
window.AgentShield.identify(userId, traits);

// Reset user identification (on logout)
window.AgentShield.reset();

// Get current identified user
window.AgentShield.getUser();

// Get session information
window.AgentShield.getSession();

// Track custom events
window.AgentShield.track(eventName, data);

// Get initialization status (debugging)
window.AgentShield.getInitInfo();

// Grant consent for cookies (GDPR)
window.AgentShield.grantConsent();

identify(userId, traits)

Associates a user with the current session. Call this when users log in.

window.AgentShield.identify('user_123', {
  email: 'user@example.com',
  name: 'John Doe',
  plan: 'premium',
});

reset()

Clears user identification. Call this when users log out.

window.AgentShield.reset();

track(eventName, data)

Track custom events.

window.AgentShield.track('button_click', {
  button: 'signup',
  page: '/pricing',
});

For complete user identification documentation, see the User Identification guide.

Common Use Cases

Form Spam Prevention

document.getElementById('form').addEventListener('submit', function (e) {
  const initInfo = window.AgentShield?.getInitInfo();
  if (initInfo?.detectionClass === 'ai_agent') {
    e.preventDefault();
    alert('Please verify you are human');
  }
});

Ad Fraud Prevention

// Only load ads for real users
if (window.AgentShield?.getInitInfo()?.detectionClass === 'human') {
  loadAdsense();
  loadDisplayAds();
}

Privacy & Compliance

Always comply with privacy regulations in your jurisdiction. The pixel respects user privacy preferences by default.

GDPR Compliance

The pixel respects data-respect-dnt="true" (default) and provides a consent API:

// Grant consent for cookies
window.AgentShield.grantConsent();

Troubleshooting

Pixel Not Loading

  1. Check that the Project ID is correct
  2. Verify the script tag is in your HTML
  3. Check for Content Security Policy blocks in the browser console
  4. Ensure no ad blockers are interfering

No Detections in Dashboard

  1. Enable debug mode (data-debug="true")
  2. Check browser console for initialization messages
  3. Verify the Project ID matches your dashboard project
  4. Check that GTM is published (if using GTM)

Next Steps