Piwik Tracking code in External JS file?


#1

Hello Is it possible to put the tracking code into an external js file?

I am not very familiar with js or external js files…I see in the tracking code there are two script tags and a noscript tag. Should I just remove the script tags (beginning and ending) and leave everything in-between to create the js file? Then include that file and just below it add the noscript tag?

If someone that knows js really well could show me how to do this that would be extremely helpful - I’m a visual type person.


(Matthieu Aubry) #2

The tracking code is already in an external file, but you need to call it on all pages, see: http://piwik.org/docs/javascript-tracking/