Events Overview
An event is something that happened — a page loaded, a button was clicked, a purchase completed. In CROForge, events are the signals Smart Code (and your site) send when those things occur. Metrics then filter and aggregate those events into conversions for campaigns. You browse and define events under sidebar Events; you do not store them inside Data Vista. Data Vista metrics point at events.
Words used on this page
| Word | Everyday meaning | Meaning in CROForge |
|---|---|---|
| Event | Something that happened. | A catalog item with a name, stable apiName, optional description, and a list of properties. Fired by Smart Code listeners or by CROFORGE.event on your site. |
| Event property vs Attribute | A property is a field on one happening. An attribute is a trait of a person. | Event properties ride on the event payload (click text, amount). Used by metric conditions and value metrics. Attributes describe the visitor/session and feed segments. |
| Payload | The contents of a package — the data sent along with the news that something happened. | The object of property apiNames and values passed into CROFORGE.event("event_api_name", { ... }), plus runtime fields Smart Code may add (such as live experiment ids). |
| Standard vs Custom | Shipped vs made by your workspace. | Standard events are system events (workspaceId null / shared): page view, click, scroll, page unload. Custom events are workspace-owned (purchase, signup). |
| apiName | A stable machine name. | The identifier you fire from code and that metrics listen for. Letters, numbers, and underscore. Marketers build metrics against these names — do not rename after metrics exist. |
| CROFORGE.event queue API | A mailbox you drop messages into before the full library is ready. | window.CROFORGE is initialized as an array. CROFORGE.event pushes ["event", name, payload] onto that queue so calls work even if init.js has not finished loading. Runtime may also expose window._CROFORGE.event inside init.js. |
| Conversion | A desired outcome. | Not an event by itself. A metric turns matching events (often with conditions) into a conversion score for the campaign. |
| Metric | A measuring stick. | Created in Data Vista; listens to one event plus optional property conditions. |
| Data type | Text, number, yes/no, or URL. | Each event property uses PROPERTY_DATA_TYPE: Text 0, Number 1, Boolean 2, URL 3 — the same types as attributes. |
| Attribute | A characteristic of the visitor. | Not copied onto every event. Used for audience segments. Do not confuse with event properties when you design metrics. |
Screenshot filename: events-list.png. Paste this page into the WordPress Code editor, then insert that screenshot from the Media library. Do not use a Markdown image tag.
Where events live in the app
Sidebar → Events (/workspace/{id}/events?id=). The id query selects which event’s details are open.
The catalog is split into:
- Standard — system events (
workspaceIdnull / shared). - Custom — workspace-owned.
Event detail tabs
When you open an event, the right panel shows four tabs:
| Tab | What you see |
|---|---|
| Properties | Event property definitions: name, apiName, data type, description. Add, edit, or delete properties here (custom events). Description in the UI: “Add properties specific to your event for more context.” |
| Metadata | System metadata: Name, API Name, Last Modified, Description, Created by, Created on. |
| API | The snippet to fire this event from the site (“API Code Snippet”). Prefer this tab over copying docs from memory — it uses the event’s real apiName and properties. |
| Sample Values | Example payloads. The screen may show a placeholder until sample data is populated. |
Client event API (web)
Product snippets typically look like this. The first two lines are the queue stub — do not change them. Then you call CROFORGE.event with the event apiName and a payload object whose keys are property apiNames.
<script>
// Do not change anything in the following two lines
window.CROFORGE = window.CROFORGE || [];
CROFORGE.event = CROFORGE.event || function () {CROFORGE.push(["event"].concat([].slice.call(arguments)))};
// Replace the property values with your actual values
CROFORGE.event("event_api_name", {
"prop_api_name": "<text_value>"
});
</script>
Use stable apiName values for events and properties. Marketers build metrics against those names. The queue pattern means you can fire events even before Smart Code has finished initializing: calls sit on the CROFORGE array until the library drains them.
Runtime may also expose
window._CROFORGE.eventinsideinit.jsas the internal dispatcher once the library is ready. Prefer the API tab snippet for the version your workspace ships.
Attributes vs event properties
| Attributes | Event properties | |
|---|---|---|
| Everyday idea | Who the visitor is | What just happened |
| Purpose in CROForge | Visitor/profile traits for segments | Fields on an event payload |
| Used by | Audience / segments | Metric conditions and value-of-property metrics |
| Identity | apiName | apiName |
Example: deviceType is an attribute (the visitor is on mobile). Click text is an event property (the button they pressed said “Book Demo”). A desktop-only test uses a segment. A “Book Demo” conversion uses a metric condition on the click event.
Onboarding order
The product path on the dashboard is: Add a source (website) → Define events → Run campaigns.
- Register the website under Configurations and install Smart Code so standard events can fire.
- Confirm standard events, then add custom events for business outcomes that click/page view cannot express cleanly.
- Create metrics that listen to those events, attach them to campaigns, and set campaigns to Running.
There is no shipped Triggers builder in this frontend. Standard listeners in Smart Code (page view, click, scroll, unload) plus CROFORGE.event from your site are how events get fired.