Setup
For more advanced reporting, you can tie a Google Analytics account to all the trees in your organization.
- Go to My Account > Organizations and Billing.
- Enter the account number, under the Google Analytics section.
Each time a node is viewed, Google Analytics will track it. Inside Google Analytics, instead of URLs, a “page view” appears with the tree ID and node number, like “123456789-1” for tree ID 123456789, node #1. Note that Google Analytics typically takes 24 hours to produce results.
Events
Two different events are fired when a tree is rendered and Google Analytics is enabled in Zingtree.
page_view
A page_view event is fired on each node that is loaded on a tree. The payload for the event is:
{
page_title: `${trees[this_tree_id].name}: ${trees[this_tree_id].nodes[show].page_title_plain}`,
page_location: `${this_tree_id}-${show}`,
userId: source
}
The page_title is a concatenated string of the tree name and the node name. page_location is a concatenated string of the Tree ID and the ID of the button that was pressed to get to the node.
resolution_state
A resolution_state event is fired when a node is encountered with its Final Node Session Result set.
The payload of this event is:
{result: 'Success'}
or
{result: 'Failure'}
depending on the Session Result that was set.