JS Events
Each Riddle type has the same set of events, making it easy to write a general event listener that will work with all Riddles. The events sent by a Riddle are listed in the table below. Along with the event action, Riddle will send an event name to specify the action. For example, the Block_View event will send the name of the block that was viewed as the event name. The CoreMetrics event will send the type of event as the event name.
JS events breakdown
Event | Event action | Event name |
---|---|---|
Core Metrics that you can also see on the analyze / statistics screen in the Riddle creator. Events can be Start, View, etc. | CoreMetrics | View |
Tracked on the first user interaction (e.g. a click, typing) | CoreMetrics | Start |
Tracked when the user views their result page | CoreMetrics | Finish |
Block viewed. A block was loaded and displayed to the user | Block_View | |
Block submitted - either an answer option was chosen or the next button was clicked in a question block | Block_Submit | |
Tracked when the user clicks 'skip' at a block | Block_Skip | |
Click on "Next" button | Block_Next | |
Form or single form field submitted | Form_Submit | |
Send form data (user inputs) | Form_Submit | |
Form or single form field skipped | Form_Skip | |
Call to action button clicked | Cta | |
Social Shares. A social share button was clicked and a social share was initiated | Social | |
Lead Settings events send data such as cookies accepted as the event name | LeadSettings | |
Data layer variables | dataLayer_{Data Layer Key} |
Unless you are using your own custom tracking script, you can use these events straight away with the most common tracking tools such as Meta Pixel (formerly Facebook Pixel), Google Analytics, Google Tag Manager, or Matomo.
Please refer to our Custom tracking page to learn more about the tools and also get sample code that will get you started working with Riddle Events.
JS events properties
Every event that happens while someone plays a Riddle is made up of different properties. Event properties/event property names will only appear or contain data if they are applicable to that block.
Here is a breakdown of these properties:
Event property | Event property name |
---|---|
Same for every Riddle to identify a particular Riddle's event, also useful for external analytics tools | category |
General short name for event that happens, slightly more detailed than category | action |
More detailed than action, e.g. View, Start, Finish | name |
The contents of the answer selected | answer |
Form data that is filled out as JSON | formAnswers |
The text entered into the description field in the Creator | blockDescription |
The number assigned to the block in the Creator | blockId |
The text entered into the title field in the Creator | blockTitle |
The sort of block used here | blockType |
Everything in a block, e.g. title, questions, images as JSON | blockContent |
Configurated block options as JSON | blockOptions |
The Riddle type used here | blockTypeGroup |
true or false to denote whether this is a 2.0 or 1.0 Riddle | isRiddle2Event |
The accumulative milliseconds spent on the Riddle in the iframe | playTimeInMilliseconds |
The unique ID automatically assigned to the Riddle in the Creator | riddleId |
Riddle data variables are sent with every event if enabled | riddleDataLayer |