Skip to main content

Ad attribution platform

An ad attribution tool where users set up tracking events, connect ad platform integrations, and manage campaigns within spaces.
var ha = window.HaloAgents.init({
  orgId: "your-org-id",
  userId: "user_123",
  apiKey: "ab_live_xxxxxxxxxxxxxxxx",
  userTraits: {
    name: "Marcus Chen",
    email: "[email protected]",
    role: "admin",
  },
  companyId: "space_456",
  companyTraits: {
    name: "Acme Media",
    plan: "pro",
    space_id: "space_456",
    monthly_ad_spend: 25000,
  },
  context: {
    active_events: {
      label: "Active Tracking Events",
      type: "list",
      value: [
        { event_name: "purchase", label: "Purchase Event", status: "active", pixel_id: "px_001" },
        { event_name: "lead", label: "Lead Submitted", status: "active", pixel_id: "px_002" },
        { event_name: "signup", label: "New Signup", status: "paused", pixel_id: "px_003" },
        { event_name: "add_to_cart", label: "Add to Cart", status: "active", pixel_id: "px_004" },
      ]
    },
    integrations: {
      label: "Connected Ad Platforms",
      type: "integration",
      value: {
        facebook_ads: { connected: true, status: "active", account_id: "act_123" },
        google_ads: { connected: true, status: "error", error: "OAuth token expired" },
        tiktok_ads: { connected: true, status: "active" },
        snapchat_ads: { connected: false },
      }
    },
    errors: {
      label: "Current Issues",
      type: "error",
      value: [
        { area: "google_ads", message: "OAuth token expired -- reconnection required", since: "2025-02-08" },
        { area: "tracking_pixel", message: "Pixel not firing on /checkout page for 'purchase' event", since: "2025-02-09" },
      ]
    },
    attribution: {
      label: "Attribution Settings",
      type: "config",
      value: [
        { setting: "model", label: "Attribution Model", value: "last-click" },
        { setting: "window", label: "Attribution Window", value: "7 days" },
        { setting: "dedup", label: "Deduplication", value: "enabled" },
      ]
    },
    usage: {
      label: "Monthly Usage",
      type: "metric",
      value: {
        events_tracked: 45200,
        events_limit: 100000,
        conversions_attributed: 3400,
        campaigns_active: 8,
      }
    }
  }
});
What the AI sees in its prompt:
[User Profile]
Name: Marcus Chen
Email: [email protected]
Role: admin

[Company: Acme Media]
Plan: pro
Space id: space_456
Monthly ad spend: 25000

[Active Tracking Events] (list)
- "Purchase Event" (event_name: purchase) -- active [Pixel id: px_001]
- "Lead Submitted" (event_name: lead) -- active [Pixel id: px_002]
- "New Signup" (event_name: signup) -- paused [Pixel id: px_003]
- "Add to Cart" (event_name: add_to_cart) -- active [Pixel id: px_004]

[Connected Ad Platforms] (integration)
- Facebook ads: connected, active
- Google ads: connected, ERROR -- OAuth token expired
- Tiktok ads: connected, active
- Snapchat ads: not connected

[Current Issues] (error)
- google_ads: OAuth token expired -- reconnection required (since 2025-02-08)
- tracking_pixel: Pixel not firing on /checkout page for 'purchase' event (since 2025-02-09)

[Attribution Settings] (config)
- "Attribution Model" (setting: model) -- last-click
- "Attribution Window" (setting: window) -- 7 days
- "Deduplication" (setting: dedup) -- enabled

[Monthly Usage] (metric)
- Events tracked: 45200
- Events limit: 100000
- Conversions attributed: 3400
- Campaigns active: 8
Example conversations the AI can now handle:
  • “Why aren’t my Google Ads syncing?” — The AI knows the OAuth token is expired and guides reconnection.
  • “Which events are paused?” — The AI references the “New Signup” event.
  • “How much of my event quota have I used?” — 45,200 of 100,000.
  • “How do I connect Snapchat Ads?” — The AI knows it’s not connected yet.

SaaS platform

A B2B SaaS product with feature flags, subscription tiers, and team management.
const ha = HaloAgents.init({
  orgId: "your-org-id",
  userId: "user_789",
  userTraits: {
    name: "Sarah Kim",
    email: "[email protected]",
    role: "team_lead",
    department: "Product",
  },
  companyId: "bigcorp",
  companyTraits: {
    name: "BigCorp",
    plan: "business",
    industry: "Fintech",
    employee_count: 500,
  },
  context: {
    features: {
      label: "Feature Flags",
      type: "feature",
      value: {
        advanced_analytics: true,
        ai_copilot: { enabled: true, variant: "v2" },
        custom_workflows: false,
        sso: true,
        audit_logs: true,
        api_access: false,
      }
    },
    subscription: {
      label: "Subscription Details",
      type: "metric",
      value: {
        plan: "business",
        mrr: 999,
        seats_used: 47,
        seats_limit: 50,
        trial_days_remaining: 0,
        next_renewal: "2025-03-15",
      }
    },
    team: {
      label: "Team Overview",
      type: "status",
      value: {
        total_members: 47,
        admins: 3,
        pending_invites: 5,
        last_member_added: "2025-02-01",
      }
    }
  }
});
Example conversations:
  • “Can I use custom workflows?” — AI knows the feature is disabled and can explain how to upgrade.
  • “How many seats do we have left?” — 3 remaining (47/50).
  • “When does our plan renew?” — March 15, 2025.

E-commerce platform

An online store with order tracking, inventory, and shipping integrations.
const ha = HaloAgents.init({
  orgId: "your-org-id",
  userId: "merchant_321",
  userTraits: {
    name: "Alex Rivera",
    email: "[email protected]",
    role: "store_owner",
  },
  companyId: "coolshop",
  companyTraits: {
    name: "CoolShop",
    plan: "premium",
    industry: "E-commerce",
    domain: "coolshop.com",
  },
  context: {
    recent_orders: {
      label: "Recent Order Issues",
      type: "error",
      value: [
        { order_id: "ORD-1234", message: "Shipping label generation failed", status: "needs_attention" },
        { order_id: "ORD-1230", message: "Payment disputed by customer", status: "disputed" },
      ]
    },
    integrations: {
      label: "Connected Services",
      type: "integration",
      value: {
        shopify: { connected: true, status: "active" },
        stripe: { connected: true, status: "active" },
        shipstation: { connected: true, status: "error", error: "API rate limit exceeded" },
        mailchimp: { connected: true, status: "active" },
      }
    },
    store_metrics: {
      label: "Store Metrics (Last 30 Days)",
      type: "metric",
      value: {
        total_orders: 342,
        revenue: 28500,
        refund_rate: "2.3%",
        avg_order_value: 83.33,
        fulfillment_rate: "94%",
      }
    }
  }
});
Example conversations:
  • “Why can’t I print shipping labels?” — AI knows ShipStation has a rate limit error.
  • “What’s my refund rate?” — 2.3% over the last 30 days.
  • “I have an order with a payment dispute” — AI references ORD-1230 specifically.

Where to go next

Context Planning

A step-by-step guide to deciding what to send and how to keep it fresh.

Web Widget

Install the widget and start sending context.