Commit 5a59dc46c63b98ccfdf939382ccb023593d49907
1 parent
8190b6dc
Exists in
master
and in
5 other branches
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,7 +497,9 @@ define(['jquery', 'handlebars', 'fastclick', 'handlebars_helpers', 'piwik'], fun | ||
497 | // _paq.push(['trackEvent', 'NavegarPara', hash || '/']); | 497 | // _paq.push(['trackEvent', 'NavegarPara', hash || '/']); |
498 | // _paq.push(['setDocumentTitle', document.domain + '/' + hash]); | 498 | // _paq.push(['setDocumentTitle', document.domain + '/' + hash]); |
499 | // _paq.push(['trackPageView']); | 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 | // console.log('event tracked.'); | 503 | // console.log('event tracked.'); |
502 | 504 | ||
503 | var scrollTop = 0; | 505 | var scrollTop = 0; |