
// Coremetrics control file for Analytics & Intelligent Offer
// Controls overall tagging on / off, and test / production switch

// Global switches - set to false to switch off analytics tagging
var cmTagging = true; // CSS site
var cmWmpsTagging = true; // WMPS homeshopping site(s)


// Prepare Coremetrics page view tag
// Passed uri + query string, category
// Returns nothing
function cmPreparePageviewTag(uri,category)
{

  if (cmTagging)
  {
    uri = uri.replace(/\?ts=\d*&?/, '?'); // remove trailing timestamp
    uri = uri.replace(/&ts=\d*/, ''); // remove trailing timestamp
    uri = uri.replace(/\?(null)?$/, ''); // remove residual empty or 'null' query string

    attributeStr = '';
    if (uri.indexOf('/error.jsp') > -1)
    {
      attributeStr = 'generic error'
    }
    else if (uri.indexOf('/page_not_found.jsp') > -1)
      {
        attributeStr = '404 error'
      }
    cmCreatePageviewTag(uri, category, '', '', attributeStr);
			
	}

}

//////////

