A couple of weeks ago, one of our users came to us with an issue: she wanted to track both the number of participants reaching the exit screen of her quiz and the type of traffic (that is, traffic sources). And she also wanted to be able to push both these pieces of information in Google Analytics.
Now of course, you can get these data directly from your campaign’s statistics in Qualifio: there is an integrated funnel of participations (per campaign step and per question) and you can use UTM if you wish to track your traffic sources.
But what if you want to be able to cross-check the data and centralise all events in Google Analytics?
In this article, we explain how you can recreate your campaigns’ funnel of participations in Google Analytics.
To start, you must have your Google Tag Manager set up in your Qualifio campaign (‘Channels’ step > ‘Tags’ section). Then, just go to your Google Tag Manager workspace and follow the steps below.
Step 1: Create a variable
Variable type: DOM Element
Selection method: CSS Selector
Element selector: body
Attribute name: id
Step 2: Create a trigger
Trigger type: Window loaded
This trigger fires on: Some window loaded elements
Select the variable you just created in Step 1 – contains – exit (or ‘intro’ or ‘questionset’ depending on which step of your campaign you wish to track here)
‘Intro’, ‘questionset’ and ‘exit’ are IDs systematically contained in the pages of your Qualifio campaigns. The point here is simply to tell Google Tag Manager to trigger an event whenever it sees those IDs being activated.
Publishing your campaigns in several languages and looking for a way to separately track those? Not a problem!In the case of our requesting user, they had the campaign published both in French and Flemish (ah, Belgium). Had they wanted to track the French and Flemish participations separately, they could have simply used ‘exitFR’ and ‘exitNL’ (instead of just ‘exit’, which would push the data for all campaigns indifferently) and set up two triggers instead of one.
How do I spot the exact label for my language?
Open your campaign in webview, right-click on the welcome screen and select ‘View source’. Access the body tag and you’ll find your id label, as shown below:
Step 3: Create a tag
Tag type: Google Analytics – Universal Analytics
Track type: Event
Category: whatever you want (I went for ‘qualifio campaign’)
Action: whatever you want (I put ‘step’ as in: what step of the campaign the player is on)
Label: Click on the ‘+’ icon then select the variable you created in Step 1
Value: You can leave this one empty
Non-interaction hit: By default ‘False’ – you can leave it this way too
Google Analytics Setting: Select or create your Google Analytics Settings variable. Alternatively, you can click ‘Enable overriding settings in this tag’ and add your tracking ID.
Tip: Don’t forget to link all the triggers which have been created in step 2 with your tag.
Step 4: If your campaign is integrated as an iframe on a subdomain…
Right under your tag configuration, keep scrolling and open the ‘More settings’ section > ‘Fields to set’
Field name: cookieDomain
This last step is very important, as it allows to properly track interactions in an iframe hosted on a subdomain.
Step 5: Watch your data being pushed in Google Analytics!
This is what it should look like in your Google Analytics real-time events overview.
From the screenshot above, you can tell that I tracked participations in a campaign published in English (from the ‘EN’ present in each label). You can also see that my quiz contains three question pages, as there are 3 ‘questionset’ events for each intro and exit events.