Skip to main content

Qualifio data layer

qlfDatalayer is a JavaScript variable available from any Tag embedded in your campaign. It contains useful data related to the current state and the last event of the campaign.

Example

<script>
qlfDataLayer = [{'title': 'My Campaign name', 'campaign_id': '720104',
'campaign_guid': 'E78A60AF-B117-436D-B89B-EF1459DCB69C',
'channel_guid': '64E87575-1D90-41B3-8171-C151D21C251F',
'parentURL': 'https://qualifio.com/catalogue/', 'domain': 'qualifioshowcases.qualifioapp.com',
'device': 'desktop', 'lg': 'fr', 'pg': '1', 'step': 'intro', 'pgi': '1',
'page_path': '/720104/fr/1/intro/1', 'optins': [], 'form_submitted': 0,
'isIdentified': 1, 'isWinner': null, 'preview': false, 'query_string': '&utm_source=newsletter'}];
</script>

Keys and values

KeyExample of valueDescription
titleMy Campaign nameTitle of the campaign
campaign_id720104Identifier of the campaign (= 6 numbers)
campaign_guidE78A60AF-B117-436D-B89B-EF1459DCB69CGlobally Unique Identifier of the campaign (= String of 36 characters, divided by 4 hyphens, specific per campaign)
channel_guid64E87575-1D90-41B3-8171-C151D21C251FGlobally Unique Identifier of the channel (= String of 36 characters, divided by 4 hyphens, specific per channel)
parentURLhttps://qualifio.com/catalogue/URL of the page containing the campaign
domainqualifioshowcases.qualifioapp.comSub-domain of the campaign
devicedesktopDevice used by the participant (values = mobile, tablet, desktop)
lgfrLanguage of the campaign
pg1Page in the global flow of the campaign (eg: Welcome screen = 1, 1st question = 2, 2nd question =3, Identity = 4...etc.)
stepintroName of the step the user is in (eg: intro = welcome screen, questions = questionnaire, identityset = form, exit = exit screen)
pgi1Internal page of the game flow (eg: Question 2 = 2, although it can be the third screen)
page_path/720104/fr/1/intro/1Path of the page of the user (replacing data from the session) Standard path is: /campaign_id/lg/pg/step/pgi
form_submitted0The form has been validated (value=1) or not (value=0)
optins[1222,7997]The list of the IDs of the checked optins.
isIdentified1Is this an identified (value=1) or unidentified (value=0) campaign
isWinnernullDid the participant win (value=1), lose (value=0) or is not known yet (value=Null).
previewTRUEYou are testing a campaign in preview mode
query_string&utm_source=newsletterURL parameters of the page containing the campaign
score5Score obtained by the participant
thematics[{"code": "spo","description": "Sport"}]A key value structure for thematics associated to your campaign
timeClient15Timing on the client/browser side

Access the keys

qlfDatalayer is a Json object stored at the first position of an Array.

Scope

qlfDatalayer is only available in the campaign's iframe, therefore it can't be used in a Tag of a minisite template.

var pagePath = qlfDataLayer[0].pagePath;
var campaignLanguage = qlfDataLayer[0].lg;
var campaignTitle = qlfDataLayer[0].title;
var myVirtualPath = qlfDataLayer[0].lg + '/' + qlfDataLayer[0].id + '/' + qlfDataLayer[0].step;