How do I track conversions on my website?

Last Updated: 11/6/2024     Tags: conversion, conversions, tracking
  • Switch Version
  • V5
  • V4

Taguchi Website Tracking Your website can be configured to send conversion data to Taguchi by installing our simple conversion tracking code.

The code needs to be installed on “goal” pages, for example a transaction confirmation page displayed after payment has been processed, or a form submission confirmation page. Every time a page with this code is viewed, it will count as a conversion within the Taguchi reporting system.

Basic Tracking

The following code can be used to log conversions in the Taguchi interface and reporting system, without needing any further configuration. However, this code does not allow additional data to be saved with the conversion.

<!-- TM conversion code -->
<script type="text/javascript">
<!--
try { var i = new Image(); i.src = "https://<client>.taguchimail.com/wi/p/" +
encodeURIComponent(window.location.href) + ".gif"; } catch (err) { }
//-->
</script>
<noscript><img src="https://<client>.taguchimail.com/wi/p/ns.gif" height="0" width="0" /></noscript>

Note that <client> must be replaced with your click-tracking domain; contact Taguchi support if you do not know what this is.

Advanced Tracking

This code allows custom data to be tracked with each conversion, including product IDs, categories, quantities and prices. Product data is automatically included in Taguchi reports and within the UI if the price and quantity are present.

<!-- TM conversion code -->
<script type="text/javascript">
<!--
(function(c) {
try { var i = new Image(); i.src = "https://<client>.taguchimail.com/wi/p/" +
encodeURIComponent(JSON.stringify(c)) + ".gif"; } catch (err) { }
})({

    /* Taguchi conversion data */
    pageUri: window.location.href,

    /* Transaction information */
    total: 133.45,

    /* Product information */
    products: [{
        id: 1007,
        clusterId: null,
        price: 12.5,
        qty: 1
    },
    {
        id: 1008,
        clusterId: null,
        price: 50,
        qty: 2
    },
    {
        id: 1009,
        clusterId: null,
        price: 20.95,
        qty: 1
    }]

});
//-->
</script>
<noscript><img src="https://<client>.taguchimail.com/wi/p/ns.gif" height="0" width="0" /></noscript>

Note that <client> must be replaced with your click-tracking domain; contact Taguchi Support if you do not know what this is.

Standard fields

The transaction record can contain top-level transaction data, including the following standard field:

Field Description
total the total value of the transaction

Where supplied, the total field will appear in Taguchi's built-in conversion reporting.

The products array can include zero or more product records, each of which may include the following standard fields:

Field Description
id the product’s ID, SKU or unique name
clusterId (optional) the numeric ID of the Taguchi cluster to which this product corresponds (can be left null)
price the unit price of this product
qty the number of this product purchased.

Custom fields

In addition, custom fields can be added to the conversion record at the same level as pageUri in the code above. These fields can also be used in target expressions, triggers and custom integrations. For example you could include an order number and shipping method:

/* Taguchi conversion data */
pageUri: window.location.href,
orderNumber: 1234,
shippingMethod: 'Express Delivery',

Custom product fields

Each product record may include any other fields necessary for target expressions, triggers or other custom integration. For example, you could also include the product name and colour:

products: [{
    id: 1004,
    clusterId: null,
    productName: 'Leather Handbag', // Additional data
    productColour: 'Red', // Additional data
    price: 22.5,
    qty: 2
}]