Blog

Home > Blog > KISSmetrics track visits to each domain separately

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 :).

Share:

Data that Moves Your Business

Connect with Marketlytics

Join 120,000+ Marketers

Stay ahead with expert insights on marketing analysis, data-driven strategies, and industry trends.

Omair

Revenue Growth Analyst
Data Unification Specialist, previously at a leading Ecommerce Giant

Case Studies

Discover our latest success stories
and see how innovative strategies
drive measurable results.

Get a Free Attribution Dashboard

Gain clear insights into what’s
driving conversions and optimize
your marketing spend with ease.

Are you Ready to Fast Track your Marketing Attribution Decisions and Maximize your ROI?

Businesses that leverage automated marketing
attribution see a 20-30% improvement in ad
spend efficiency.