Repository navigation
Links Report
The Links page reports short links of your site: how often each link was shown, how often it was clicked, the click-through rate, the sessions with a click and the sales it led to. It reads three event names that any short link plugin or redirect sends (the Links convention).

- Serve your short links under a path prefix of your own, for example
/go/<slug>. - Record the clicks one of two ways, never both:
- Without server code: add the link rule
/go/ out(Settings, Page script, Link rules). The page script sendsoutwith the slug when a visitor clicks a/go/link. This works for static redirects and redirects on another service too. - From the redirect: set
ignorePathPrefixesto that prefix (Settings, Page script), so the page script records no_download,_formor link rule for those links, and sendoutfrom the redirect as below.
- Without server code: add the link rule
- Send
seenfrom the page andconvfrom your server as below, if you use them. - Open Links. Pick "Links by" (Link, Placement, Page, Channel, Source, Campaign, Landing page, Country, Device). With Link selected, Details opens one link with its placements.
- Optional: import the built-in Links dashboard template; it creates the goal
Link clickson import.
| Event | Sent by | How | Properties | Revenue |
|---|---|---|---|---|
out (click) |
the redirect, server side, once per answered redirect, or a link rule in the page script |
recordEvent or an in-process post to the in route without Origin; a link rule needs nothing |
slug (required), place (optional; a link rule sends none) |
none |
seen (impression) |
the page | window.__ec.event("seen", { s0: "alpha-offer", s1: "beta-offer@offers-table" }) |
s0 to s9, up to ten link keys; a key is <slug> or <slug>@<place>
|
none |
conv (sale) |
your server, with an API key |
POST agent/v1/events (scope write:events) |
slug, place
|
val, cur, oid
|
The names are LINK_EVENTS in @infinitnet/cookieless-analytics/contract; a plugin may copy them instead of importing the package.
import { recordEvent } from "@infinitnet/cookieless-analytics/server";
// Frontmatter of src/pages/go/[slug].astro, for GET and POST only. Do not await it before redirecting.
const ref = Astro.request.headers.get("referer");
const from = ref && new URL(ref).origin === Astro.url.origin ? new URL(ref).pathname : undefined;
void recordEvent(Astro.locals, { name: "out", ...(from ? { u: from } : {}), p: { slug: "alpha-offer", place: "sidebar" } }, Astro.request);
return Astro.redirect("https://partner.example.com/offer", 302);/go/ out
~^/recommends/([^/]+) out
A click on /go/alpha-offer/ sends out with slug alpha-offer, a click on /recommends/beta-tool?x=1 sends out with slug beta-tool. A matched rule sends its one event and stops: the click gets no _outbound and no _download. Rule clicks carry the visit's channel, source, country and device, as they come from the page. See Events, Link rules.
<script>
window.__ecq = window.__ecq || [];
window.__ecq.push(["event", "seen", { s0: "alpha-offer@sidebar", s1: "beta-offer@offers-table" }]);
</script>curl -X POST "https://example.com/_emdash/api/plugins/cookieless-analytics/agent/v1/events" \
-H "X-Api-Key: $KEY" -H "content-type: application/json" \
-d '{"events":[{"name":"conv","val":12.5,"cur":"EUR","oid":"P-2201","p":{"slug":"alpha-offer","place":"sidebar"}}]}'- One click record per click. A short link is a same-host link, so the page script records no
_outboundfor it. - Send
outonly forGETandPOST, never forHEADor a prefetch. -
uof anoutevent is the path of the page that held the link (a same-origin referrer); without one, leave it out. - Channel, source, campaign, landing page, country and device come from the visitor's session, which the click joins by visitor key. A click without a counted session shows as
(not set). - Bots and privacy signals follow the same rules as page views.
- Goal: one event goal
Link clicks, matchis, valueout. A goal per link adds the propertyslug. Never define a goal on_formor_outboundfor short links.
| Column | Meaning |
|---|---|
| Impressions | link keys of seen events |
| Clicks |
out events |
| CTR | clicks / impressions from the sums, 0 without impressions |
| Sessions with a click | distinct sessions with a click |
| Conversions |
conv events, every currency |
- A key without a placement counts under
(none). - When the site records revenue, the page adds revenue in one currency; amounts of two currencies are never added.
- The chart shows sessions with a link click per day. It counts visits with at least one page view; clicks of visits without a page view are in the table only.
- The
pagefilter keeps visits that viewed that page. The page a link was clicked on is the "Page" breakdown.
Agent API: report links through agent/v1/query (scope read:analytics), params.by (link, place, page, channel, source, campaign, entry, country, device), params.slug for one link, params.withRevenue for revenue.
curl -X POST "https://example.com/_emdash/api/plugins/cookieless-analytics/agent/v1/query" \
-H "X-Api-Key: $KEY" -H "content-type: application/json" \
-d '{"report":"links","query":{"from":"2026-10-01","to":"2026-10-31"},"params":{"by":"place","slug":"alpha-offer"}}'| Key | Default | What it does |
|---|---|---|
linkRules |
empty | Link rules, for example /go/ out: the page script sends the click itself. A matched rule sends its one event and stops (no _outbound or _download). |
ignorePathPrefixes |
empty | Short link prefixes, one per line or comma separated, for example /go/. Links and form targets under them get no _download, _form or link rule event. A prefix must start with /; one containing a word of the neutral public footprint is dropped. |
rawRetentionDays |
760 |
Days of detailed rows; older ranges read the daily link summaries. |
-
seen: up to ten link keys per event (s0tos9). - Before the detailed window (or over the scan budget when every filter applies) the report reads daily link summaries: by link (all links, one link, or one filter on channel, country or device) and by place. Each day keeps its top 200 links and 200 placements; the rest is
(other). Other breakdowns answerraw_onlythere. - Dashboard tiles of
linksshow no amounts.
- Clicks without a counted session (for example a direct hit on the short link) appear with
(not set)and do not raise "Sessions with a click". -
convsent withoutsidis unattributed; add the visit'ssidwhen you have it. - Forgetting
ignorePathPrefixesturns short links that end in.pdfinto_downloadevents and forms posting to them into_formevents. - Use either
ignorePathPrefixeswith a redirect that sendsout, or a link rule, never both on the same prefix: both would count every click twice. A link rule under a prefix ofignorePathPrefixesis refused on save, and the page script applies no rule there, but a redirect that sendsoutwithout its prefix inignorePathPrefixesplus a rule still counts twice.
Events, Goals and funnels, Revenue and refunds, Dashboards and sharing, Agent API and MCP, Settings reference. Full reference: https://github.com/infinitnet/cookieless-analytics/blob/main/docs/integration.md
Cookieless Analytics by Infinitnet, Apache-2.0. These pages are generated from docs/wiki in the repository; edit them there, not here.
Start
Reports
- Reports
- Filters and segments
- Search Satisfaction
- Goals and funnels
- Revenue and refunds
- Links report
- Search integrations
- Content and site search
Sending data
Sharing and context
Sites
Admin
Running it