Custom events
Custom events record actions a pageview does not cover, such as signup, add-to-cart, or play, and show up in ConsoleWeb analyticsEvents and Event analysis. Amounts fit better on the server. See Server events quickstart.
Parameters
On the website, call webcount.track(name, props). name is required and is cut at 100 characters. props keeps at most 20 keys. Keys are cut at 50 characters, strings at 200, and only strings, numbers, and booleans are kept.
Names registered in the catalog must be snake_case, start with a letter, be at most 40 characters, and must not start with $, _, or wc_. $ is for app presets. A double underscore is for autocapture.
The name is the key in your data: once it is in the event catalog, do not rename it; the display name can change later. Use the same name for the same action on web, app, and mini program so All-platform analytics can put them together. Only add properties you will break down by, and do not put raw input text in them.
Defaults & limits
Before the script loads, push calls onto window.__wcq as ['track', 'signup', { plan: 'pro' }]. They flush when the script runs. A failure does not throw on the page. The collector drops a repeat from the same visitor on the same path and query within one second when the name and properties match.
Example
<script async src="https://YOUR_ORIGIN/w.js" data-site="YOUR_SITE_KEY"></script>
<script>
window.__wcq = window.__wcq || [];
window.__wcq.push(['track', 'signup', { plan: 'pro' }]);
</script>If the script is already there, call webcount.track('signup', { plan: 'pro' }).
Errors
An empty name is ignored. Objects and arrays are not stored as property values. A reserved prefix cannot be registered from the inbox. Over-long names and properties are truncated silently in the browser; the event is not dropped for exceeding a limit. Server fields are in Server events & log import.
Autocapture & definitions
When autocapture is on and the plan includes it, the first pageview response loads the identity script, which then loads the autocapture script; it records clickable elements and never captures password fields, a data-wc-ignore subtree, or the chat container. A click becomes an analyzable event only after you accept it in the inbox.
Parameters
Sample rate is a percent, default 100. Below 100, sampling is stable per device id, so the same person is not captured one visit and skipped the next; with no device id it is random. The deny list is a set of up to 20 selectors. Text capture is off by default and only takes effect at collection tier 3. Scroll is off. Batches default to 20 events or about 2 seconds.
Three clicks within about 300 milliseconds and 50 pixels also emit a rage click.
Defaults & limits
If autocapture is off or the plan does not include it, those requests are dropped. Candidates are built daily, or you can generate them in the inbox right away. Accepting one creates a rule and backfills the last 90 days. The name still has to follow the reserved-prefix rules in Events & properties.
Example
On ConsoleAll-platform analyticsDataEvent inbox accept a candidate and give it a snake_case name, or merge it into an existing event instead of naming every button separately. The page does not need a track call first. Events you already send in code are not renamed by that rule.
Errors
A bad selector is ignored and does not break the page. High or low confidence only changes sort order. Ignoring a candidate does not delete clicks already stored.
Enhanced measurement
The website script sends these events automatically alongside pageviews, and data-auto-track="false" turns them all off. Rage clicks are not among them; they follow autocapture. See Autocapture & definitions.
Events & defaults
| Event | Event name | Default | When it sends |
|---|---|---|---|
| Outbound click | __outbound | On | The link host is different |
| File download | __download | On | The path ends in a common document, archive, or installer extension |
| Form submit | __form | Off | The script attribute enables forms |
| Not found | __404 | On | The 404 template marks the script |
| Vitals | __vitals | On | Once, when the first page hides |
| Site search | None; stored on the pageview | On | The landing query matches a parameter name |
Parameters
Outbound and downloads can be turned off with data-outbound="false" and data-downloads="false"; only http and https links count, so mailto and script links are skipped. Forms listen only with data-forms="true", and they store id, name, and action, not field values. The 404 flag, data-404="true", belongs on the error-page script. Vitals can be turned off with data-vitals="false"; otherwise they report a few first-load timings. Site search defaults to s, q, and search, edited in web settings.
Defaults & limits
If project settings disable outbound, downloads, forms, 404, or errors, the collector drops that event even if the script sent it. Site search is not its own event. The term is stored on that pageview.
Example
<script async src="https://YOUR_ORIGIN/w.js" data-site="YOUR_SITE_KEY" data-forms="true"></script>On a 404 page, also set data-404="true". Do not set that on ordinary pages.
Errors
Downloads match the extension only. A dynamic download URL is not counted. Vitals are skipped when no metric was observed. A wrong search parameter leaves the referrer and no search term.