TRM
Tracking management client javascript code for Hiiir Ads platform
usage
npm install trm
Generate library
Trm is a tracking code for PMD platform, you can generate a new library in your localhost.
trm = require("trm")
// will generate a library in `./tmp/test.js`
result = trm.generateLib({
domain: "yahoo.com.tw",
destPath: "./tmp/test.js"
})
// code reulst
console.log(result.code);
result.then(function (result) {
// show file content and save data in destination path
console.log(result);
})
client usage
call trm and import code that is from trm source.
//code is from compressed out = trm; trm;
Client code output,
That is output code from trm.resultDisplay()
!{return windowanalytics={var neo;document||n=documentntype="text/javascript"nid="analytics-js"nasync=!0nsrc="https:"===documentlocationprotocol?"https://":"http://"+"localhost:8080/.tmp/test.js"o=document0oparentNodee=windowonloadwindow{return e&&}}VERSION:"0.1.3"}; windowanalytics; windowanalytics;
TODO
- client side auto test