Page Views

A PageView tracker is a generic action by a visitor. Example use-cases for this tracker are:

  • Landing pages
  • Campaign pages
  • Email content

The information registered by a pageView tracker will show when and where the action was triggered on your website.

Each page may declare a pageId, which is an identifier used to differentiate pages from each other. This can both be used to present statistics per page, and also to re-target users based on what specific pages they have visited.

Every pageId may be located on one or many pages. It is also possible to generate a pageId by using the following fallback action:

None (default)

No pageId is generated. Statistics are gathered for the whole site.

Title

The HTML title tag of the page that was loaded.

Url

The HTTP URL address of the page that was loaded, including query parameters etc.

Referrer

The HTTP header that identifies the address of the webpage that linked to the resource being requested. This is useful if the script is located in an iframe.

Note: Explicity declared pageId's will always take precedence over above fallback mechanisms.

PageView Variables

The following tables contain implementation details about variables supported when using the Delta Projects tracker scripts.

All variable names and values are case sensitive.

Variable Definition Importance Notes
action The string representing an action that should trigger. Required Value must be "pageView" to register a pageView.
pageId Unique reference string to identify the current page. Optional Example value: "p1234". Recommended if the script is placed in an iframe.

Tracker implementation guidelines

General conventions

String encoding

All strings going in or out of Delta Projects must be in UTF-8.

Secure pages

The Delta Projects javascript tracker automatically adjusts for secure pages. You can use it on either protocol.

Tracker placement

There are no restrictions on where to put the javascript tracker, our recommendation is to put the script at the end of body as per yahoos best practices for speeding up your web site. But since the script is asynchronous and every measure has been taken not to block your page from loading the choice of placement is in your hands.

Placeholders

The tracker script added to pages should never contain the placeholder values, please remove the variable entirely if not used/needed. See examples below. Note that YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID will be replaced by Delta Projects.

YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID

In the examples in this document YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID is a placeholder string. In the trackers shipped from Delta Projects this placeholder is replaced with the id of your account in Delta Projects systems.

YOUR_PAGE_ID

The pageId variable is used to track specific pages. If the tracker script is wrapped in an iframe the pageId is mandatory for tracking that specific page. Tracking of pages can also be accomplished without the pageId by using either the title, the referrer or the URL of the page.

Format Options

Our tracker may be implemented in a number of ways. The most common implementation is a small javascript placed on the client web page where one or more actions should be tracked.

The tracker scripts used for the implementation may be downloaded from the Delta Projects UI or sent to you by email from Delta Projects staff.

Sample implementations of our different tracker formats.

pageView tracker example

Standard example for registering pageView actions without pageId.

<script type="text/javascript">
  var _d7=_d7||[];

  _d7.push({action:"pageView"});

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>

Example for registering pageView actions with pageId.

<script type="text/javascript">
  var _d7=_d7||[];

  _d7.push({action:"pageView", pageId:"p1234"});

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>

Example for registering pageView actions with a delayed trigger after 10 seconds.

<script type="text/javascript">
  var _d7=_d7||[];

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();

  function showredPage() {
      _d7.push({action:"pageView"});
  };

  setTimeout(showredPage, 10000);
</script>

Example for registering pageView actions initially + delayed trigger after 5 seconds.

<script type="text/javascript">
  var _d7=_d7||[];

  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();

  _d7.push({action:"pageView", pageId:"Startpage"});

  function showredPage() {
    _d7.push({action:"pageView", pageId:"Startpage-Delayed"});
  };

  setTimeout(showredPage, 5000);
</script>

Example for registering pageView actions initially + pageId actions on click events.

### Main script part of the setup ###
<script type="text/javascript">
  var _d7=_d7||[];
  (function(){
    var d=document.createElement("script"),s=document.getElementsByTagName("script")[0];
    _d7.id="YOUR_UNIQUE_DELTA_TRACKING_ACCOUNT_ID";_d7.p=("https:" == document.location.protocol ? "https://" : "http://");
    d.src=_d7.p+"tb.de17a.com/d7.js";d.type="text/javascript";d.async=1;s.parentNode.insertBefore(d,s);
  })();
</script>
###

### Click part of the setup ###
<script type="text/javascript">
  function pushOnClickCar1() { _d7.push({action:"pageView", pageId:'ClickCar1'})
  }
  function pushOnClickCar2() { _d7.push({action:"pageView", pageId:'ClickCar2'})
  }
</script>
###

### Part of script for the footer and general pageView ###
<script type="text/javascript">
  _d7.push({action:"pageView"});
</script>
###

### Click events setup ###
<a id="ford" onclick="pushOnClickCar1()" href="#">Car1</a>
<a id="volvo" onclick="pushOnClickCar2()" href="#">Car2</a>

Last modified: Wed Apr 27 2016 11:20:06 GMT+0200 (Central European Summer Time)

results matching ""

    No results matching ""