Skip to main content
Skip table of contents

Google Tag Manager

Snowplow Tag

The Corvidae subdomain must be set up before this tag is published, please replace the trackerId string with a string matching your Corvidae subdomain.

Tag Title

Corvidae Snowplow

This is a suggestion, you may follow any pre-established nomenclature that you wish.

Tag Type

Custom HTML

HTML

CODE
<script type="text/javascript">
;(function(p, l, o, w, i, n, g) {
    if (!p[i]) {
        p.GlobalSnowplowNamespace = p.GlobalSnowplowNamespace || [];
        p.GlobalSnowplowNamespace.push(i);
        p[i] = function() {
            (p[i].q = p[i].q || []).push(arguments);
        };
        p[i].q = p[i].q || [];
        n = l.createElement(o);
        g = l.getElementsByTagName(o)[0];
        n.async = 1;
        n.src = w;
        g.parentNode.insertBefore(n, g);
    }
}(
  window,
  document,
  "script",
  "//cdn.corvidae.ai/2.9.0/sp.js",
  "qcpixel"
));
  
// Pixel setup
var trackerId = 'corvidae.[your tracked domain]';
var appId = '[your tracked domain]';
var cookieDomain = '[your tracked domain]';
  
qcpixel('newTracker', 'cf', trackerId, {
    appId: appId,
    forceSecureTracker: true,
    cookieDomain: cookieDomain,
    respectDoNotTrack: true,
    platform: 'web',
});
</script>

Trigger

Page View / All Pages
Trigger Type: Page View

Please use the same “all pages” trigger that you use for other customer-facing analytics solutions.

Pageview Tag

This pixel tracks all clickstream traffic and referrer information and should be implemented on every customer-facing page on your site.

Tag Title

Corvidae Pageview

This is a suggestion, you may follow any pre-established nomenclature that you wish.

Tag Type

Custom HTML

HTML

CODE
<script type="text/javascript">
var qcPageView = function() {

  // Omit this block if not tracking User ID
  var userId = {{visitorId}}; //please replace this variable
  if (userId !== null) {
    try {
      qcpixel('setUserId', userId);
    } catch (err){}
  }
  // -----
  
  var title = document.title;
  qcpixel('trackPageView', title);
};

qcpixel(function() {
  qcPageView();
});
</script>

Advanced Settings

Tag Sequencing > Fire a tag before Corvidae Pageview fires > Corvidae Snowplow

Setting the Corvidae Snowplow as the “Setup Tag” ensures that these tags fire in the correct order.

Trigger

Trigger Type: Dom Ready
Fires on: All Dom Ready Events

Conversion Tag

The conversion pixel should only be fired on a successful conversion. It is important to pass the transaction value as our attribution models rely on it.

Values passed to the Corvidae Pixel in this example are set up as variables within Google Tag Manager and are expected to be drawn from the dataLayer or scraped from the DOM. The dataLayer or DOM must be populated before this script runs.

Tag Title

Corvidae Conversion

This is a suggestion, you may follow any pre-established nomenclature that you wish.

Tag Type

Custom HTML

HTML

CODE
<script type="text/javascript"> 
var qcCheckout = function(){
  var orderId = {{transactionId}}; // unique order ID required
  var currency = 'GBP';  // currency code required
  var revenue = {{transactionTotal}}; // revenue required
  var shipping = {{transactionShipping}}; // shipping optional
  var tax = {{transactionTax}}; // tax optional

  // omit this block if not tracking User ID
  var user_id = {{visitorId}}; // user ID optional
  if (user_id !== null) {   
    try {
      qcpixel('setUserId', user_id);
    } catch (err){}
  }
  // -----

  qcpixel(
    'addTrans',
    orderId,
    '[your account ID]',
    String(revenue),
    tax,
    shipping,
    '', '', '',
    currency
  );
  qcpixel('trackTrans');
}
qcCheckout();
</script>

Advanced Settings

Tag Sequencing > Fire a tag before Corvidae Pageview fires > Corvidae Snowplow

Setting the Corvidae Snowplow as the “Setup Tag” ensures that these tags fire in the correct order.

This tag must fire after the required variables are available.

Trigger

Trigger Type: Page View
Fires on: Successful transaction pages, such as the “thank you” page

Required Variables

Variable Name

Description

transactionId

A unique ID for the transaction. This is used to deduplicate repeat conversions so must be persistent.

transactionTotal

The total monetary value of the transaction.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.