mirror of
https://github.com/LBRYFoundation/lbry.com.git
synced 2025-08-23 09:37:26 +00:00
tracking to matomo
This commit is contained in:
parent
16085c8aee
commit
59b4abff16
2 changed files with 20 additions and 2 deletions
|
@ -22,6 +22,20 @@
|
|||
fbq('track', '<?php echo Response::getFacebookPixelAnalyticsType() ?>');
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var _paq = window._paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
_paq.push(['setLinkTrackingTimer', 750]); // increase to 750 milliseconds
|
||||
(function() {
|
||||
var u="https://analytics.lbry.com/";
|
||||
_paq.push(['setTrackerUrl', u+'matomo.php']);
|
||||
_paq.push(['setSiteId', '2']);
|
||||
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+'matomo.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<?php else: ?>
|
||||
<script>
|
||||
window.ga = function() {};
|
||||
|
|
|
@ -8,8 +8,12 @@ $(document).ready(function() {
|
|||
function onAnchorClick() {
|
||||
var anchor = $(this);
|
||||
|
||||
if (anchor.data('analytics-category') && anchor.data('analytics-action') && anchor.data('analytics-label') && window.ga) {
|
||||
ga('send', 'event', anchor.data('analytics-category'), anchor.data('analytics-action'), anchor.data('analytics-label'));
|
||||
if (anchor.data()['analyticsCategory'] && anchor.data()['analyticsAction'] && anchor.data()['analyticsLabel'] && window.ga) {
|
||||
ga('send', 'event', anchor.data()['analyticsCategory'], anchor.data()['analyticsAction'], anchor.data()['analyticsLabel']);
|
||||
}
|
||||
|
||||
if (anchor.data()['analyticsCategory'] && anchor.data()['analyticsAction'] && anchor.data()['analyticsLabel'] && window._paq) {
|
||||
_paq.push(['trackEvent', anchor.data()['analyticsCategory'], anchor.data()['analyticsAction'], anchor.data()['analyticsLabel']]);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue