JavaScript for Informz Web Tracking

To use web tracking, you need to add some JavaScript code to your website (Informz provides this code). This requires the skills of a web administrator with the appropriate permissions.

Planning

Before you start adding the code, there are some initial planning steps that will help you with web tracking.

  1. Place the page visits and duration code in an area on your website that is accessible by all pages (typically the header or footer for each page).
  2. Identify the key interactions that you would like to monitor – interactions that Informz will track so that you can further tailor your targeted mailings and your campaign flows. Here are some examples:
    1. Who is accessing your event calendar?
    2. Who is downloading a key white paper?
    3. Who is using a specific search term?
    4. Who is visiting an event landing page?

Look for interactions that will identify the intent or level of interest of the user. Tracking too many interactions will make them difficult to interpret!

To assist you, Informz provides a spreadsheet on the web tracking page. Navigate to Admin > Setup > Web Tracking to access this spreadsheet. It will help you with the mapping and organization of interactions that you wish to track on your website.

The Code

The following subsections show examples of code that will help you with your planning and orientation. Do not use these examples on your website; rather click View Instructions on the Web Tracking Setup page to obtain JavaScript that has been customized to work with your Informz account. The code needs to be in place for you to begin using web tracking.

Page Tracking Code

Place this JavaScript code on every page of your website. It tracks page views and viewing duration.

<script>
//-------------------------------------------------------
var z_account = "Your ID Populated Here from Instruction Page";
var z_collector = " Your Server Populated Here from Instruction Page ";
var z_cookieDomain = " Your Domain Populated Here from Instruction Page";
//-------------------------------------------------------

(function (e, o, n, r, t, a, s) { e[t] || (e.GlobalSnowplowNamespace = e.GlobalSnowplowNamespace || [], e.GlobalSnowplowNamespace.push(t), e[t] = function () { (e[t].q = e[t].q || []).push(arguments) }, e[t].q = e[t].q || [], a = o.createElement(n), s = o.getElementsByTagName(n)[0], a.async = 1, a.src = r, s.parentNode.insertBefore(a, s)) }(window, document, "script", "http://"+z_collector+"/web_trk/sp.js", "informz_trk")), informz_trk("newTracker", "infz", z_collector + "/web_trk/collector/", { appId: z_account, cookieDomain: z_cookieDomain }), informz_trk("setUserIdFromLocation", "_zs"), informz_trk("enableActivityTracking", 30, 15); informz_trk("trackPageView", null);
</script>

Interaction Tracking Code

This code is used to track website interactions. As you go through your website, add a row to your spreadsheet (Admin > Setup > Web Tracking > View Instructions) for each interaction you wish to track. Note that the combination of Category and Action shoud have a unique identifier for the interaction for your entire site. Your website administrator will use the code samples below to fill-in the code column in the spreadsheet before making the website updates.

informz_trk('trackStructEvent',
'Download Whitepaper',        // Category (Required, use only: Letters, Numbers & Spaces )
'Benefits_of_membership',     // Item (Required, use only: Letters, Numbers & Spaces)
'Used top link'               // Value (Optional)
);

Purchase Tracking Code

This code is used to track purchasing information on your site.

  • Call addItem for each item of the purchase that you want to track.
  • Call trackTrans once per page to submit all of the addItem calls to Inforrmz.
informz_trk('addItem',
'12345',          // Order ID (Required)
'Z99',            // SKU or Code (Required, Letters & Numbers only, must be unique per item)
'T-Shirt',        // Product Name (Required)
'Green Medium',   // Category (Required)
'11.99',          // Unit Price (Required)
'1'               // Quantity (Required)
);

Next Steps

Once the tracking code is in place, visit your website's home page. This will cause the JavaScript to execute for the first time. If everything is installed properly, Informz will tell you that it is receiving data from your domain.

Free Sample!

Before you start tracking, consult the example website in your account to a see a fully working page that you can use as a basis for your own implementation!