Site and page variables

 

Foreword

Before using variable addition methods, please make sure you have initialised the AT Internet JavaScript Tracker and selected the Page plugin from the Tag Composer interface.

 

Principle

 

Site variables

The objective of these variables is to be able to associate information specific to your activity (interface language, load times, number of articles per page, etc.) with your site.

 

Page variables

By way of these variables, you can evaluate the performance of specific pages of your site, notably those offering fields to be filled out (purchase forms, sign-up forms, subscription forms, etc.). In concrete terms, you can retrieve all values of these form fields, then use an analysis to view the form’s status after submission (attempts to fill out the form that do not go through are not taken into account).

 

Tagging

The Tracker has a “customVars.set()” method enabling the definition of the variables’ values. This method takes, as a parameter, an object whose properties are as follows:

  • site: Object containing IDs and names associated with site variables.
  • page: Object containing IDs and names associated with page variables.

Sending identified visitor information requires the presence of a page tag: “tag.page.set()” or “tag.page.send()”.

 

Tagging examples

    1. Tagging a page with site variables:
      var tag = new ATInternet.Tracker.Tag();
      tag.page.set({
          name:'pageName'
      });
      tag.customVars.set({
          site: {
              1: '[site1]',
              5: '5',
              20: '[site20]'
          }
      });
      tag.dispatch();
    2. Tagging a page with page variables:
      var tag = new ATInternet.Tracker.Tag();
      tag.page.set({
          name:'pageName'
      });
      tag.customVars.set({
          page: {
              1: '[page1]',
              5: '5',
              20: '[page20]'
          }
      });
      tag.dispatch();
    3. Tagging a page with site and page variables:
      var tag = new ATInternet.Tracker.Tag();
      tag.page.set({
          name:'pageName'
      });
      tag.customVars.set({
          site: {
              1: '[site1]',
              5: '5',
              20: '[site20]'
          },
          page: {
              1: '[page1]',
              5: '5',
              20: '[page20]'
          }
      });
      tag.dispatch();
    4. Tagging variables with the “page.send()” method:

      Tagging variables via the “page.send()” method requires passing the “customVars” object directly as a parameter:

      var tag = new ATInternet.Tracker.Tag();
      tag.page.send({
          name:'pageName',
          customVars: {
              site: {
                  1: '[site1]',
                  5: '5',
                  20: '[site20]'
              },
              page: {
                  1: '[page1]',
                  5: '5',
                  20: '[page20]'
              }
          }
      });

 

 

Annexe

TypeExample
Value / ID / Duration
// [...]
site: {
  1: 123
}
// [...]
Text
// [...]
site: {
  1: '[abc123]' // text between brackets []
}
// [...]
Date
// [...]
site: {
  1: 20180810 // yyyymmdd
}
// [...]
Decimal
// [...]
site: {
  1: 2.5
}
// [...]
Country
// [...]
site: {
  1: '[de]' // 2 letters country code between brackets []
}
// [...]
Last update: 13/08/2018