helpdesk-z / helpdeskz-dev

HelpDeskZ is a free PHP based software which allows you to manage your site's support with a web-based support ticket system.
http://www.helpdeskz.com/
GNU General Public License v2.0
83 stars 64 forks source link

Google Analytics script #48

Closed Mixerboy24 closed 2 years ago

Mixerboy24 commented 2 years ago

Hi,

In which file can Google Analytics code be placed?

I couldn't find a direct solution to the matter, I thought to ask if anyone would have come up with a place for it.

Atte / Mixer

Mixerboy24 commented 2 years ago

Hello,

I added the Analytics code to the Helpdesk.js file. There, at least, it works properly and on every page.

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-XXXXXXXXX-X', 'auto');
ga('send', 'pageview');

Atte / Mixer