Skip to main content

GTM

Use case
  • GTM is loaded in the parent page (your website or the minisite template of your campaign)
  • Events fired by the Qualifio campaign are pushed to the GTM datalayer in the parent page
Import our GTM container file

A container file is a .json file that allows you to easily add preconfigured triggers and variables into your existing GTM container.

Simply download it here and import it to your account.

⚠️ Make sure you choose the "Merge" option when you import the file. This is really important because this option will keep your existing tags, triggers and variables, and just add the new ones from Qualifio. If you choose the "Overwrite" option, it will clear your existing GTM container and delete ALL your tags, triggers and variables.

Variables

GTM-ID

Recommended

If you have several GTM containers and you will publish your Qualifio campaigns as a minisite.

Create variable GTM ID

OPTIN-ID

Recommended

If you expect to track form submitted events only when a specific opt-in has been ticket (e.g. : newsletter subscription)

Create variable OPT-IN ID

Tags

GTM container (minisite)

Create GTM container Tag

  • Head
    <!-- Google Tag Manager -->
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
    })(window,document,'script','dataLayer','{tv:gtm-id}');</script>
    <!-- End Google Tag Manager -->
  • Body
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id={tv:gtm-id}"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
  • Usage
    Only from minisite template

    Use GTM container Tag from minisite

GTM event "First page"

  • Body
    <script type="text/javascript"> 
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.pageNumber() == 1) {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_step',
    'qlf_step':'first',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    });
    </script>
  • Usage
    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event "Welcome screen"

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.getStepName() == 'intro') {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_step',
    'qlf_step':'welcome',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event "Questions screen”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.getStepName() == 'questionset') {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_step',
    'qlf_step':'questions',
    'qlf_question':qlfDataLayer[0]['pgi'],
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event "Identification form”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.getStepName() == 'identityset') {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_step',
    'qlf_step':'form',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event "Exit screen”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.getStepName() == 'exit') {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_step',
    'qlf_step':'exit',
    'qlf_profile':'{group}',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event “Participate button”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.getStepName() == 'intro') {
    $('#jouer').click(function(){
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_action',
    'qlf_action':'participate',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    });
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event “Question answered”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.getStepName() == 'questionset') {
    $('#suivant1, #next, .answerPic, [id^=check_choix]').click(function(){
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_action',
    'qlf_action':'question_answered',
    'qlf_question':qlfDataLayer[0]['pgi'],
    'qlf_title':qlfDataLayer[0]['title'],
    'qlf_path':qlfDataLayer[0]['page_path']
    }]);
    }]);
    });
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event "Form submitted”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.isFormSubmittedRightNow()) {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_action',
    'qlf_action':'form_submitted',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    });
    </script>
  • Usage

    Only from campaign Tags

    Use GTM event from campaign Tags

GTM event "Form submitted with opt-in”

  • Body

    <script type="text/javascript">
    $(function() {

    var tp = _qlf_taggingplan;

    if (tp.isFormSubmittedRightNow()) {
    if(tp.isOptin({tv:optin-id})) {
    _qual_async.push(['requestPlugin', 'qualp', 'datalayer', function() {
    _qual_async.push(['sendParentMessage', 'datalayer/dataLayerPush', {
    'event':'qlf_event_action',
    'qlf_action':'form_submitted_with_optin',
    'qlf_title': qlfDataLayer[0]['title'],
    'qlf_path': qlfDataLayer[0]['page_path']
    }]);
    }]);
    }
    }
    });
    </script>
  • Usage

    Only from campaign tags

    Select tag from campaign “Tracking tags &amp; pixels” section

    Set the expected opt-in ID

    Set expected opt-in ID