But as i see when i try to remove that ga function throws me error ga is not defined
FullPageDestroy();
$('main').html(section);
var title = event.match(/<title[^>]*>([^<]+)<\/title>/)[1];
$('head title').html( title ); // this setup title
//if browser doesn't support CSS transitions - dont wait for the end of transitions
var delay = ( transitionsSupported() ) ? 30 : 0;
setTimeout(function(){
$('body').removeClass('page-is-changing');
$('.cd-cover-layer').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
isAnimating = false;
$('.cd-cover-layer').off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend');
});
ga('set', 'page', '/' + url); // here i get error if i remove title
ga('send', 'pageview');
Here is full function
function loadNewContent(url, bool) {
url = ('' == url) ? 'index.html' : url;
var section = $('<div class="cd-main-content "></div>');
section.load(url+' .cd-main-content > *', function(event){
// load new content and replace <main> content with the new one
FullPageDestroy();
$('main').html(section);
//var title = event.match(/<title[^>]*>([^<]+)<\/title>/)[1];
//$('head title').html( title );
//console.log("TITLE = " + title);
//if browser doesn't support CSS transitions - dont wait for the end of transitions
var delay = ( transitionsSupported() ) ? 30 : 0;
setTimeout(function(){
$('body').removeClass('page-is-changing');
$('.cd-cover-layer').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){
isAnimating = false;
$('.cd-cover-layer').off('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend');
});
ga('set', 'page', '/' + url);
ga('send', 'pageview');
FirstLoad();
HeroSection();
Sliders();
FullPage();
MasonryPortfolio();
LazyLoad();
HideShowHeader();
FooterAppear();
Lightbox();
AppearIteam();
BackToTop();
ContactForm();
CollagePlus();
PageShare();
PageChat();
if( !transitionsSupported() ) isAnimating = false;
}, delay);
if(url!=window.location && bool){
window.history.pushState({path: url},'',url);
}
});
}