How do I track clicks on my website?

Last Updated: 8/8/2025     Tags: web, track, tracking, click, clicks
  • Switch Version
  • V5
  • V4

Web tracking allows you to track websites visited once a subscriber has clicked from an email, through the use of the Taguchi web tracking script. The script just needs to be included on all pages in your website and a few extra optional parameters to add further information (such as product information, SKU's and product category if a subscriber views a product page on your website).

Page Tracking

The following code can be used to log page visits 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 tracked page visit. This script is ideal for use on all pages of your website (apart from product pages, see product page tracking for further information).

<!-- TM web tracking code -->
<script type="text/javascript">
<!--
(function(c) {
try { var i = new Image(); i.src = "https://<client>.taguchimail.com/wi/wa/" +
encodeURIComponent(JSON.stringify(c)) + ".gif"; } catch (err) { }
})({
    /* Taguchi web page data */
    pageUri: window.location.href
});
//-->
</script>
<noscript><img src="https://<client>.taguchimail.com/wi/wa/ns.gif" height="0" width="0" /></noscript>

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

Single Page Application (SPA)

If your website is a Single Page Application (SPA) and sub-page views are tracked using internal history change events from tools like Dynatrace, Clarity, or TikTok:

  • Ensure that page views triggered by Google Tag Manager (GTM) include both traditional page loads and history change events.​
  • If GTM currently tracks only full page loads, configure it to fire the Taguchi tracking code on history change events as well.

Product Page Tracking

This code allows custom data to be tracked with each page visit, including product SKU's, category, and other information. It is important to populate these variables with applicable product information. This script is ideal for product pages where one product is present.

<!-- TM web tracking code -->
<script type="text/javascript">
<!--
(function(c) {
try { var i = new Image(); i.src = "https://<client>.taguchimail.com/wi/wa/" +
encodeURIComponent(JSON.stringify(c)) + ".gif"; } catch (err) { }
})({
    /* Taguchi web page data */
    pageUri: window.location.href,
    /* Custom page view fields go here: arbitrary keys/values to be used for targeting */
    productName: "example product name",
    productSku: "example product SKU",
    productCategory: "example product category"
});
//-->
</script>
<noscript><img src="https://<client>.taguchimail.com/wi/wa/ns.gif" height="0" width="0" /></noscript>

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

How to test tracking code and ensure it's passing data into Taguchi

  1. Set up an email activity that contains a link to the page or site where the tracking code has been added.
  2. Send a proof to yourself and click on the link within the proof.
  3. Let the site load.
  4. Right click anywhere on the page and go to 'Inspect' to bring up the developer console. Our support assistant can help, if you are unsure on how to do this.
  5. Go to the 'Storage' or 'Application' tab of the developer console and then to 'Cookies'.
  6. Select the relevant site domain under the 'Cookies' folder.
  7. If the pixel loads and a cookie was dropped you will see the cookie name: _tm_sevt
  8. You can also check the 'Network' tab of the developer console to see if the pixel has been loaded. This will show up as a gif and the name will contain the pixel source url - which will contain your click tracking domain.
  9. Finally, if the code is implemented, the pixel loads correctly and a cookie is dropped, you will see an 'Anayltic' event on a subscriber's profile.

Troubleshooting

Issue: Analytic event not showing on a subscriber's profile

  • Ensure you are going to the page via an email sent from Taguchi.
  • Check that the tracking has been added correctly and is in the header of your page.
  • Check that the pixel is loading and a cookie is being fired off.

Please contact Taguchi Support for further assistance on our tracking code.