Fired when a profile makes its first request to a website since at least 24 hours after their previous visit. The event is queued from the request-handling path and raised asynchronously once the visit has been recorded, with event id "userVisit". Automations and funnel goals listen for this event to trigger visit-based rules, and it exposes the visited path, the request cookies and a rolling count of daily visits made this week.
Group: Journeys
Implements: TriggerEvent, FunnelEvent
Properties
| Property | Returns | Description |
|---|---|---|
| attributes | Map<String,Object> | Extra attributes attached to this event. Always an empty, mutable map for this event since none are populated when it is constructed. |
| cookies | Map<String,String> | The cookies that were sent with the request that raised this event, keyed by cookie name. |
| eventId | String | The persistence-friendly identifier for this event type, always "userVisit". |
| leadProfile | Profile | The profile associated with this event for lead-tracking purposes. Always the same profile returned by getSourceProfile. |
| numDailyVisitsThisWeek | int | Counts how many distinct days the visiting profile has accessed the website so far this week, from the start of the current week up to now. Queries the access log on each call, so treat it as an expensive lookup rather than a cached value. |
| relatedLead | Lead | The lead already associated with this event, if any. Always null for a visit event since visits are not tied to an existing lead. |
| sourceProfile | Profile | The profile whose visit raised this event. |
| triggerItem1 | String | The trigger key value used to match this event against automations, set to the id of the visited website. |
| triggerItem2 | String | The trigger key value used to match this event against automations, set to the path that was requested. |
| triggerItem3 | String | Unused trigger key for this event. |
| triggerItem4 | String | Unused trigger key for this event. |
| triggerItem5 | String | Unused trigger key for this event. |
| website | Website | The website the profile visited to raise this event. |
Inherited from TriggerEvent
Properties
| Property | Returns | Description |
|---|---|---|
| serialisable | boolean | Whether this event's attributes were built to survive being persisted, ie every value is a plain serialisable value rather than a persistent entity or some other object that only makes sense inside the firing transaction. Only the firing app can know this, so it declares it - see EventBuilder. An agent that subscribes to an event does not run when it fires. The event is written to storage as JSON, buffered with others, and read back minutes later in a different session, so a value that cannot be written and read back is not merely awkward, it breaks the whole delivery. The agent framework therefore ignores any event which does not say yes here. |
Methods
isSerialisable()
Returns: boolean
Whether this event's attributes were built to survive being persisted, ie every value is a plain serialisable value rather than a persistent entity or some other object that only makes sense inside the firing transaction. Only the firing app can know this, so it declares it - see EventBuilder. An agent that subscribes to an event does not run when it fires. The event is written to storage as JSON, buffered with others, and read back minutes later in a different session, so a value that cannot be written and read back is not merely awkward, it breaks the whole delivery. The agent framework therefore ignores any event which does not say yes here.
Methods
toProps() · getEventId() · getWebsite() · getSourceProfile() · getTriggerItem1() · getTriggerItem2() · getTriggerItem3() · getTriggerItem4() · getTriggerItem5() · getAttributes() · getNumDailyVisitsThisWeek() · dailyVisits(Date from, Date to) · getCookies() · getLeadProfile() · getRelatedLead()
toProps()
Returns: Map<String,Serializable>
Builds the serialisable property map used to describe this event to automations and external systems such as LLMs. Extends the base event properties with the visited path and a URN reference to the website.
getEventId()
Returns: String
The persistence-friendly identifier for this event type, always "userVisit".
getWebsite()
Returns: Website
The website the profile visited to raise this event.
getSourceProfile()
Returns: Profile
The profile whose visit raised this event.
getTriggerItem1()
Returns: String
The trigger key value used to match this event against automations, set to the id of the visited website.
getTriggerItem2()
Returns: String
The trigger key value used to match this event against automations, set to the path that was requested.
getTriggerItem3()
Returns: String
Unused trigger key for this event.
getTriggerItem4()
Returns: String
Unused trigger key for this event.
getTriggerItem5()
Returns: String
Unused trigger key for this event.
getAttributes()
Returns: Map<String,Object>
Extra attributes attached to this event. Always an empty, mutable map for this event since none are populated when it is constructed.
getNumDailyVisitsThisWeek()
Returns: int
Counts how many distinct days the visiting profile has accessed the website so far this week, from the start of the current week up to now. Queries the access log on each call, so treat it as an expensive lookup rather than a cached value.
dailyVisits(Date from, Date to)
Returns: List<DayStat>
Looks up the visiting profile's per-day visit counts for the website over the given date range. Queries the access log on each call.
| Parameter | Description |
|---|---|
from | the start of the date range to count visits from, inclusive |
to | the end of the date range to count visits to, inclusive |
getCookies()
Returns: Map<String,String>
The cookies that were sent with the request that raised this event, keyed by cookie name.
getLeadProfile()
Returns: Profile
The profile associated with this event for lead-tracking purposes. Always the same profile returned by getSourceProfile.
getRelatedLead()
Returns: Lead
The lead already associated with this event, if any. Always null for a visit event since visits are not tied to an existing lead.