Rock Mobile Docs

Interaction

Mv1.0

Inherits from ContentView

Whenever someone views a page in the mobile app, a page view interaction is automatically logged on the server. These interactions are typically queued and sent in bulk every minute or so.

But sometimes, you might want to log a custom interaction based on what the user did on the page—for example, tracking when they view a specific blog article. And yes, we know content channels now offer built-in ways to handle that too.

Anyway, this control doesn’t take up any space and offers a simple way to log a custom interaction. Just provide the Operation, Summary, and ChannelId, along with either a ComponentId or ComponentName. Everything else is optional.

Properties

PropertyTypeDescription
ChannelIdintThe identifier of the channel where this interaction will be recorded. Must already exist.
ComponentIdint?Specifies a specific component identifier where this interaction will be recorded. If used, the component must already exist. Defaults to null.
ComponentNamestringSpecifies a component name for where this interaction will be recorded. If you use this property to pick the component then the system will look for a matching component and if not found create one.
DatastringCustom data that should be stored with the interaction. There is no specific format requirements, as long as the data is a string.
EntityIdint?Associates the interaction with the specified entity. The entity type will be taken from the channel configuration. Defaults to null.
OperationstringThe type of operation that identifies this interaction. There is no specific list of strings that you must use, but a few suggestions are View and Watch.
SummarystringThe text that describes this event in a user friendly manner.
<Rock:Interaction Operation="Watched video"
    Summary="Watch"
    ChannelId="28"
    ComponentName="{{ video.Name | Escape }}"
    Data="{{ video.Url | Escape }}" />