Events Overview

Documents / Events

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

WordEveryday meaningMeaning in CROForge
EventSomething 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 AttributeA 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.
PayloadThe 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 CustomShipped 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).
apiNameA 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 APIA 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.
ConversionA desired outcome.Not an event by itself. A metric turns matching events (often with conditions) into a conversion score for the campaign.
MetricA measuring stick.Created in Data Vista; listens to one event plus optional property conditions.
Data typeText, 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.
AttributeA 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 (workspaceId null / shared).
  • Custom — workspace-owned.

Event detail tabs

When you open an event, the right panel shows four tabs:

TabWhat you see
PropertiesEvent 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.”
MetadataSystem metadata: Name, API Name, Last Modified, Description, Created by, Created on.
APIThe 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 ValuesExample 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.event inside init.js as the internal dispatcher once the library is ready. Prefer the API tab snippet for the version your workspace ships.

Attributes vs event properties

AttributesEvent properties
Everyday ideaWho the visitor isWhat just happened
Purpose in CROForgeVisitor/profile traits for segmentsFields on an event payload
Used byAudience / segmentsMetric conditions and value-of-property metrics
IdentityapiNameapiName

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.

  1. Register the website under Configurations and install Smart Code so standard events can fire.
  2. Confirm standard events, then add custom events for business outcomes that click/page view cannot express cleanly.
  3. 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.


Related reading