The Google Analytics integration allows organizations to send information on tasks & success scores to Google Analytics. Combining Task Analytics with your existing web analytics software will provide you with valuable information that goes beyond the standard page views and clicks. Your web analytics experts are able to analyze customer journeys per individual task, create segments, check completion rates and make deep-dives to find the root cause of problems.
The Task Analytics script will automatically detect if the environment Task Analytics is running on is using the Google dataLayer. If this is the case, the survey will push an event to the dataLayer once visitors have indicated whether they could complete a task or not. Task Analytics will sent one Google Analytics event; after the user answers the “Did you complete what you came for?” question with “yes” or “no”.
1) Enable the Google Analytics integration
Make sure you have toggled on the Google Analytics integration under Setup → Settings with the checkbox seen in the screenshot below:
Toggle on the "Google Analytics" checkbox to enable the integration
2) Validate the DataLayer Push
If the Google Analytics checkbox is checked, an event will be fired, regardless whether you’ve set-up the event trigger in Google Tag Manager. It’s not going to cause errors if you haven’t yet, the data will still be pushed in the dataLayer.
The data that is pushed to the dataLayer:
- event: "TaskMetrix"
- taskName: "<taskName> [<taskCode>]"
- taskResult: "Completed" // or “Gave in"
Red text = variables
You can check whether the event is pushed to the dataLayer by filling out the survey. Once you’ve answered the “Were you able to complete your task?”
, you will see an extra array object in the dataLayer. You can access the dataLayer via the console, typing “dataLayer”
Check the dataLayer push by typing "dataLayer" in the console of your browser The preview URL parameter does not fire dataLayer push events
Don’t use the preview URL parameter (?_tmcf) when validating the Google Analytics integration. The data will not be submitted to Task Analytics nor Google Analytics. This is to prevent filling the database with test data.
Set up Google Tag Manager
The last step is defining the dataLayer variables, trigger and tag in Google Tag Manager. This means:
- Creating the variables (taskName, taskResult)
- Setting up the trigger, called “TaskMetrix”
- Set up a tag to fire an event
With the information above, you will be able to define your own variables, create your own tag and trigger. You can use the Google Tag Manager preview function to verify if the event is fired and variables are sent to Google Analytics.
Use the Task Analytics import container
We’ve created a Google Tag Manager import container, containing the necessary elements to make Google Tag Manager work with Google Analytics and Task Analytics. Read the instructions
Analyzing results in Google Analytics
Users can answers questions multiple times, using the “previous” button. It’s possible to have multiple (conflicting) Google Analytics events (“yes” and “no”) from the same person. Within Task Analytics, only the most recent answer is taken into account. In Google Analytics, however, the event will be registered every time the user answers the question.