Tracking code dependencies
Data accuracy and precision are critical for the analysis of user behaviour over longer periods of time.
This is why InnerTrends tracking technology does not use cookies to identify unique users and relies on having this information provided by the app it tracks.
The identity of logged-in users should be made available to InnerTrends through JavaScript global variables.
If this method is not available, InnerTrends is also able to read the identity of the users from cookies, local storage or directly from the page source.
Another piece of critical information for data accuracy is the date and time when a logged-in user created his account. We require this data to be formatted as Unix timestamp (UTC timezone).
If this information is already available in your app, make sure to share this information with your dedicated InnerTrends analyst so he can map it to your tracking code.
Identifying users
If the user identity and the signup date are not available in your app in a way that can be accessed through JavaScript, please add the following code above your InnerTrends tracking code:
<script type="text/javascript"> var dataLayer=dataLayer||[]; //Fill in the account details of the logged in user: dataLayer.push({ "account":{ "id":"XXXX", "email":"email@address.com", "created_at":XXXXXXXX //UNIX Timestamp in your system when the account was created. }}); </script>
In case your application allows main accounts to invite secondary users, guests or 3rd parties to manage their account, make sure to add this information in the dataLayer as well.
<script type="text/javascript"> //Fill in the account details of the subaccount or shared user: dataLayer.push({ "subaccount":{ "id":"XXXX", "email":"email@address.com", "created_at":XXXXXXXX //UNIX Timestamp in your system when the account was created. }}); </script>
Sending events
InnerTrends will capture most events that happen inside your application such as page loads, clicks, Ajax requests etc.
In case you need to send specific events, please use the following structure:
<script type="text/javascript"> var dataLayer=dataLayer||[]; //Fill in the account details of the logged in user: dataLayer.push({ "trackEvent":{ "name":"Event Name Goes Here", "eventProperty":"Property Value Goes Here" // as many properties as you need. }}); </script>