mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-28 18:38:17 +00:00
DSS-5888 DSS-5875 Adds tracking for users. Adds client side tracking for keyword and init for Piwik script module
This commit is contained in:
parent
946d92dcbb
commit
a0d5cdf755
@ -1955,21 +1955,29 @@
|
||||
{{/if}}
|
||||
</script>
|
||||
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u="//piwik.corp.linkedin.com/piwik/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 93]);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
|
||||
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="//piwik.corp.linkedin.com/piwik/piwik.php?idsite=94" style="border:0;" alt="" /></p></noscript>
|
||||
<!-- End Piwik Code -->
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
|
||||
</body>
|
||||
@if(user) {
|
||||
// Sets user name for user tracking on Piwik once logged in
|
||||
_paq.push(['setUserId', '@user']);
|
||||
}
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function () {
|
||||
var u = "//piwik.corp.linkedin.com/piwik/";
|
||||
_paq.push(['setTrackerUrl', u + 'piwik.php']);
|
||||
_paq.push(['setSiteId', @piwikSiteId]);
|
||||
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
|
||||
g.type = 'text/javascript';
|
||||
g.async = true;
|
||||
g.defer = true;
|
||||
g.src = u + 'piwik.js';
|
||||
s.parentNode.insertBefore(g, s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="//piwik.corp.linkedin.com/piwik/piwik.php?idsite=94" style="border: 0;" alt="" /></p></noscript>
|
||||
<!-- End Piwik Code -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -16,6 +16,9 @@
|
||||
const {value: keyword} = searchInput;
|
||||
const searchRouteHash = `#/search?keywords=${encodeURIComponent(keyword)}&category=${global.g_currentCategory}&source=default&page=1`;
|
||||
keyword && (document.location.hash = searchRouteHash);
|
||||
|
||||
// Piwik track search keyword
|
||||
_paq.push(['trackSiteSearch', keyword, global.g_currentCategory, false]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user