First-party Site Tracking
Install AEO Goal's first-party tracking tag to connect AI referrals with conversions and revenue.
Last updated November 18, 2026
First-party Site Tracking connects visits from AI assistants, search engines, and advertising campaigns to conversions and revenue. It is independent of GA4: the browser tag sends events directly to AEO Goal’s write-only collection endpoint.
Before you start
You need:
- An AEO Goal brand with the correct primary domain.
- Permission to edit the site’s global HTML, CMS header, or tag manager.
- A consent decision for your jurisdiction and visitor audience.
- A stable conversion ID from your checkout or backend, such as an order ID.
Install the site-wide tag
- Open App → Site Tracking for the brand.
- Copy the generated site-wide tag.
- Add it to the global
<head>or equivalent site-wide tag-manager container. Do not paste it only on the home page. - Publish the site or tag-manager container.
- In AEO Goal, add the site’s allowed origin if the site uses a separate checkout or domain. Origins are hostnames, not paths.
- Confirm that Site Tracking is enabled.
The generated tag looks like this; use the key and API origin shown in your account rather than copying these example values:
<script>window.aeo=window.aeo||function(){(aeo.q=aeo.q||[]).push(arguments)};</script>
<script async src="https://app.aeogoal.com/t/v1.js"
data-aeo-key="aeo_pk_your_brand_key"
data-aeo-api="https://api.aeogoal.com"></script>
The tag is safe to load asynchronously. It uses sendBeacon when available and a keepalive request as a fallback, so it should not block navigation.
Configure consent
If consent is required, select the consent-required option before copying the tag. The generated tag includes data-aeo-consent="required". Nothing is sent and no durable visitor cookie is written until your consent banner calls:
aeo('consent', true);
Call this only after the visitor has accepted the category of tracking that covers attribution analytics. If consent is denied, do not call it. Confirm the correct legal basis and retention policy with your privacy advisor; AEO Goal does not determine your legal obligations.
Record conversions
Put the conversion call on the order-confirmation, lead-confirmation, or equivalent success path. Use a stable ID generated by the transaction system, not a random value generated on every page load:
aeo('conversion', {
id: 'ORDER-1001',
value: 129.50,
currency: 'EUR',
email: 'buyer@example.com'
});
id makes retries idempotent. value and currency allow net revenue reporting. Email and phone are optional matching signals and are hashed in the browser; never put raw values in URLs or logs. For subscriptions, send the business event your team has defined as the conversion and keep its ID stable across retries.
What is measured
The tracker can capture:
- One or more consented visitor touches, with a first-party visitor ID.
- Landing URL and external referrer, excluding internal navigation as a referral.
- UTM campaign fields and advertising click IDs such as
gclid,gbraid,wbraid,msclkid,fbclid,ttclid,li_fat_id, andrdt_cid. - AI-engine classification for recognized assistant referrers or AI campaign tags.
- Conversion event name, stable event ID, value, currency, and optional hashed match signals.
- Refund events, which reduce net revenue and do not count as new conversions.
- AI referral sessions, conversions, net revenue, observed/modelled attribution, AI landing pages, and Share of Mind correlation in the report.
The tracker does not read arbitrary page content, record keystrokes, fingerprint visitors, or require GA4. Bots are flagged and excluded from AI referral performance. Hashes are still personal data under GDPR and remain subject to your retention and erasure policy.
Verify the installation
Use this checklist in a test environment or with a clearly marked test order:
- Open a page on the allowed origin with the browser developer tools Network panel open.
- Confirm a
POST /api/collect/touchrequest is sent after the page loads. - Confirm the response is successful and the Site Tracking event count increases.
- Submit one test conversion with a unique ID, for example
TEST-ORDER-2026-11-18-001. - Confirm
POST /api/collect/conversionsucceeds and the conversion appears in the AI attribution report when the test touch was classified as AI traffic. - Repeat the same conversion ID and confirm it is not counted twice.
- Remove or erase test data according to your data policy.
If collection is rejected, check the public key, Site Tracking enablement, the request Origin, allowed origins, active plan/rollout, and the site’s daily event cap. Collection is intentionally write-only: the public key cannot read attribution data.
Google Ads conversion feed
Site Tracking can expose eligible Google-click conversions through a scheduled HTTPS CSV feed:
- Open App → Site Tracking → Google Ads feed.
- Issue credentials and copy the password immediately; it is shown once.
- In Google Ads, create or select matching conversion actions and configure a scheduled HTTPS upload using the feed URL and HTTP Basic credentials.
- Enable ad-platform sharing in AEO Goal.
- Check the feed status and last-fetch time after Google’s first scheduled pull.
The feed includes conversions matched to a gclid, gbraid, or wbraid recorded before conversion, within the supported 90-day window. It does not expose feed credentials through MCP or normal status responses. Revoke and reissue credentials if they are lost.
MCP access
Agents with platform:read access can query:
get_ai_referral_performanceget_conversion_attributionget_revenue_by_ai_engineget_ai_conversion_dead_endsget_google_ads_feed_status
These tools are read-only, brand-scoped, and use the same first-party ledger and feed status shown in the app.