Commit 5a59dc46c63b98ccfdf939382ccb023593d49907

Authored by Leonardo Merlin
1 parent 8190b6dc

check if piwik object exist before use-it.

Showing 1 changed file with 3 additions and 1 deletions   Show diff stats
js/main.js
... ... @@ -497,7 +497,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun
497 497 // _paq.push(['trackEvent', 'NavegarPara', hash || '/']);
498 498 // _paq.push(['setDocumentTitle', document.domain + '/' + hash]);
499 499 // _paq.push(['trackPageView']);
500   - _paq.push(['trackPageView', 'navigateTo', hash, lastHash]);
  500 + if (window._paq){
  501 + window._paq.push(['trackPageView', 'navigateTo', hash, lastHash]);
  502 + }
501 503 // console.log('event tracked.');
502 504  
503 505 var scrollTop = 0;
... ...