Skip to content

Analytics and attribution API

Report AI referrals and linked conversions using data your customer connects or sends. Read recorded activity and estimates of AI influence through the API.

Home / Products / Analytics and attribution API

Start with your customer’s data

Attribution links recorded visits or outcomes to a source under a defined rule. A referral is a visit with information about where it came from. A conversion is an outcome you record, such as a lead or a purchase. Use the attribution dataset to report those counts and associated revenue by brand.

This API is for developers building customer reports, agencies reviewing referral traffic, and brand teams that already record leads or purchases. Your customer must connect data or send it from a system that already records the activity. The API does not install a tracker or collect private visitor activity by auditing a website. Public competitor audits do not give you access to a competitor’s visits, leads, or revenue.

If your customer uses Google Analytics 4 (GA4), our team can help connect the property with their authorization. A property is the GA4 record that holds analytics for a site or app. The property must already record the activity you want to report.

What each attribution model returns

A model is the rule used to group or associate activity with a source. Choose it with the model parameter in GET /v2/analytics/{dataset} using the attribution dataset.

  • same_session is the default. Use it to read recorded AI referrals and conversions linked within the same visit session.
  • last_observed_ai_30d looks for the last recorded AI referral within 30 days. It needs evidence linking activity across sessions to the same visitor.
  • modeled_influence can return estimated conversions and revenue with lower and upper bounds. When evidence is insufficient, the model returns insufficient_data. Check missing_inputs and limitations before displaying an estimate.
  • ga4_reported returns totals for the connected GA4 property after the first import. These totals stay separate from attribution based on individual events. When you group results by date, the GA4 date follows the property’s time zone.

Rows can include source, currency, referrals, conversions, revenue, model, and a coverage note. Revenue uses the currency’s smallest unit, such as cents for US dollars. Preserve the currency when displaying the amount. A missing count can come back as null. Keep that state visible so a reader can tell when the API has no value to show.

Estimated models do not prove that an AI answer caused a visit or sale. Label estimated counts and ranges in reports. Keep GA4 totals in their own view so readers can identify the source and avoid adding totals that may describe the same activity.

Send events and read the results

  1. Choose the brand and map the existing records to referral, conversion, or refund events. Supply the event time, your event identifier, source, session identifier, and consent reference. A consent reference identifies the permission to share the event.
  2. For a referral, include the referring URL or campaign source when available. For a conversion, include your conversion identifier, the amount in the currency’s smallest unit, and the currency. Use zero for a lead with no monetary value.
  3. Send POST /v2/attribution/events from your server with an attribution:write key. A request takes up to 1,000 events and requires max_units, the credit cap for the request. Supply the required request key header to identify the submission. If you retry, resend the same header value and body.
  4. Check the receipt for the number accepted, the duplicate count, and any rejected items. Save the ingestion ID with your submission record so you can refer to the batch when reviewing the receipt.
  5. Read GET /v2/analytics/{dataset} with an attribution:read key. Set the brand, model, and time range. You can group rows by up to three fields, such as date, source, and currency.

Read same-session attribution

Set AEO_API_BASE_URL to https://api.aeoapi.dev. Set AEO_API_KEY on your server and use the identifier of a brand you can read. Supply UTC timestamps for START_AT and END_AT. The start is included in the range. The end is excluded.

curl --fail-with-body --get "$AEO_API_BASE_URL/v2/analytics/attribution" \
  -H "Authorization: Bearer $AEO_API_KEY" \
  --data-urlencode "brand_id=$BRAND_ID" \
  --data-urlencode "start_at=$START_AT" \
  --data-urlencode "end_at=$END_AT" \
  --data-urlencode "model=same_session"

The default page holds up to 50 rows. You can request up to 100. If the response includes meta.next_cursor, send that value as cursor with the same filters to read the next page.

For an agency’s weekly client report, group by source and show the referral and conversion counts for each source. If you report by country or language, leave the value unknown when your customer’s event records lack that detail. Read coverage_note with each row to give readers context about the underlying data.

Review page traffic and search performance

Use GET /v2/analytics/{dataset} with url_impact to review tracked pages and customer-reported daily traffic. For example, after an editor revises a product page, show daily referral sessions for that URL over the review period. The response identifies the page and returns traffic rows with the day, kind of traffic, source, and count. A day without a report has unknown traffic.

To set up a tracked page or supply traffic totals, use PUT /v2/brands/{brand_id}/evidence/{kind}/{key} with impact_target or traffic. Page traffic totals come from the customer’s records. A report can include both referral sessions and requests from automated programs. Use the traffic kind to label each count.

For search performance, query search_performance by date, search query, or page. The engine filter accepts Google, Bing, or a split by engine. Use bing_insights for a Bing website or property. To review which pages appeared as sources in collected AI answers, use the citation intelligence API.

Plans and access

The Optimizer plan costs $399 per month and includes attribution and URL impact. It includes 10 brands, 60,000 credits per month, and 12 months of history. Search performance and Bing insights are available on Analyzer and Optimizer. Reads use zero credits. Sending attribution events can use credits.

Request access through the contact form. Our team emails an invitation. Use the account portal to manage keys, view usage, and handle billing. Read the results through the API and present them in your reports or product.

Questions

What data do I need to provide?

Send visit and conversion records your customer is allowed to share, or authorize a connection to a Google Analytics 4 property that already records the activity. Read the attribution event requirements.

Does attribution install a website tracker?

Your existing systems collect the data. Your server sends the events, or the API reads totals from an authorized Google Analytics 4 property. See how to read event data and GA4 totals.

Can an estimate prove an AI answer led to a sale?

No. Estimated influence cannot prove that an AI answer caused a visit or a sale. The API can return insufficient_data when it lacks the evidence to make an estimate. See the attribution model options.

Can I count leads that have no dollar value?

Yes. Send a conversion event with the value set to zero for a lead that has no monetary value. Read the conversion event fields.

How can I break down attribution results?

You can group attribution based on events by date, source, or currency. If the event includes the brand location, you can group by location too. Google Analytics 4 totals have no brand location breakdown. See attribution grouping options.

Which plan includes attribution?

The Optimizer plan includes attribution event intake, attribution reads, and URL impact. Both plans include the search performance and Bing insights datasets. Compare Analyzer and Optimizer.