KISSmetrics track visits to each domain separately

Have KISSmetrics installed on multiple domains? Want to see visits and conversion rate for each domain? Now you can this script fires an event whenever a user visits one of your domains. Will showup in KM as an event: Visited blog.yourdomain1.com Visited yourdomain2.com and so on...

// Segment Visitors by hostname
  jQuery(document).ready(function(){
    var refKm = document.referrer;
    var hostKm = document.location.hostname;
  
    // checks if visitor is from a different referrer
    if((hostKm.length > refKm.length && hostKm.indexOf(refKm) === -1) ||
      refKm.indexOf(hostKm) === -1)
      {
        _kmq.push(['record', 'Visited '+ hostKm]);
      }
  });

This comes in handy when you want to see stats for each domain separately or want to calculate conversion rate for visitors who have visited a particular site area. For example comonversion rate for people who visited blog.

Remember more granularity always comes in handy :).

Don't miss out when new resources launch

Our customer analytics experts share wisdom only once a month

Share now

We are a digital analytics consultancy that helps businesses turn customer and marketing data into clear, actionable insights. We empower teams to optimize performance, make smarter decisions, and drive measurable growth.