function track(){ if(arguments[0])trackPageviewURL=arguments[0]; try { callNum++; if (callNum>2)callNum=1; //alert(callNum); if(callNum==1) { pageTracker1 = getTracker(UAId); pageTracker=pageTracker1; } if(callNum==2) { pageTracker2 = getTracker(UAId); pageTracker=pageTracker2; } // when a page has rewrite url, GA will track the rewrite url therwise it uses url from browser. debug('UAId='+UAId); debug('project='+project+''); debug('sponsor='+sponsor); if (!trackPageviewURL) { if(project!='other') { trackPageviewURL='/DCSext.p_Sector/DCSext.p_Category/WT.cg_n/dcsuri'; } else { trackPageviewURL='/spon'+sponsor+'/DCSext.p_Sector/DCSext.p_Category/WT.cg_n/dcsuri'; } } else { if(project=='other' && UAId!='UA-7012908-8') { trackPageviewURL="/spon" + sponsor+ trackPageviewURL; } } trackPageviewURL=replaceMetas(trackPageviewURL); trackPageviewURL=removeSpaces(trackPageviewURL); debug('trackPageviewURL='+trackPageviewURL+''); pageTracker._trackPageview(trackPageviewURL); } catch (err) { debug(err)} // This is for testing purpose. it has to be removed after testing. // debug('Page has been tracked successfully'); //Track again using a second tracking, all these events will be tracked using a single, static UAId if (UAId!='UA-7012908-8') { debug('Second Tracking'); var origUAId=UAId; UAId='UA-7012908-8'; track(); UAId=origUAId; } } track();