This is an example of using jsdom to add Piwik tracking code to an HTML file.
-
Install depencies
$ npm install
-
Launch the app from the Terminal:
$ node index.js
The file sample_tracking.html based on sample.html will be created (or overwritten). It contains the Piwik tracking code as first script tag inside the body element.