{"_id":"@168bj4/analytics-mtm","_rev":"1-5afc078f47f76321c759a85bfcc0dbbb","name":"@168bj4/analytics-mtm","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.3":{"name":"@168bj4/analytics-mtm","version":"0.0.3","keywords":["analytics-mtm"],"author":{"name":"Scott Yen"},"license":"MIT","_id":"@168bj4/analytics-mtm@0.0.3","maintainers":[{"name":"168bj4","email":"168bj4@gmail.com"}],"homepage":"https://github.com/168bj4/Analytics-Mtm","bugs":{"url":"https://github.com/168bj4/Analytics-Mtm/issues"},"dist":{"shasum":"9c989309fffd1755eacf6823a501706318b1b6ba","tarball":"https://registry.npmjs.org/@168bj4/analytics-mtm/-/analytics-mtm-0.0.3.tgz","fileCount":3,"integrity":"sha512-UT+Fl71eP12vC6jp8XI7XPG/4JuhCQ60WP0OrVRl7hCsa8AjBixkyFY7peIrVzY12rR9tPFG8i1h/zLI+JycCw==","signatures":[{"sig":"MEYCIQCzNHF2YHuHc7xJ5tgRxsbCJuQtZ/lfEDJqt2QuqSDMaAIhANTilGapalAIGAg2s3vBSamWZ3UVcgZCaULQbAQXEOAW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6565},"main":"dist/index.js","gitHead":"2f9b656580c3ea74cfbecb0c0c85f6e882d0119c","scripts":{"build":"npx babel ./src/main.js --out-file ./dist/index.js && npx uglifyjs ./dist/index.js --output ./dist/index.js"},"_npmUser":{"name":"168bj4","email":"168bj4@gmail.com"},"repository":{"url":"git+https://github.com/168bj4/Analytics-Mtm.git","type":"git"},"_npmVersion":"8.11.0","description":"This plugin is used to install analytics matomo tag manager functions for frontend nuxt projects","directories":{},"_nodeVersion":"16.15.1","_hasShrinkwrap":false,"devDependencies":{"uglify-js":"^3.17.4","@babel/cli":"^7.21.0","@babel/core":"^7.21.0","@babel/preset-env":"^7.20.2"},"_npmOperationalInternal":{"tmp":"tmp/analytics-mtm_0.0.3_1694417110950_0.7086363654733563","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@168bj4/analytics-mtm","description":"This plugin is used to install analytics matomo tag manager functions for frontend nuxt projects","version":"0.1.0","main":"dist/index.js","keywords":["analytics-mtm"],"author":{"name":"Scott Yen"},"license":"MIT","devDependencies":{"@babel/cli":"^7.21.0","@babel/core":"^7.21.0","@babel/preset-env":"^7.20.2","uglify-js":"^3.17.4"},"scripts":{"build":"npx babel ./src/main.js --out-file ./dist/index.js && npx uglifyjs ./dist/index.js --output ./dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/168bj4/Analytics-Mtm.git"},"homepage":"https://github.com/168bj4/Analytics-Mtm","bugs":{"url":"https://github.com/168bj4/Analytics-Mtm/issues"},"gitHead":"3806e2fcda1116fcdfef58400ea673e3d6199ef5","_id":"@168bj4/analytics-mtm@0.1.0","_nodeVersion":"16.15.1","_npmVersion":"8.11.0","dist":{"integrity":"sha512-7Nh6zWCK8+JjJcvH5o//zk+09FgwIjjbT7gwL/sGtFXdv4DIWjwmB9sgu7Qm8q3NyUk5ZoO6SY8U+gMPBaCVbA==","shasum":"dc76e1ef0596ff00253a1aae7f9a5051950aa871","tarball":"https://registry.npmjs.org/@168bj4/analytics-mtm/-/analytics-mtm-0.1.0.tgz","fileCount":3,"unpackedSize":6505,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGSHx1NR+tpbkM5xVehy6bOrNv7wTmCmjH54pA4MoQESAiEAj7H49Qld1nfkybZ5Ko/IW2rzFA2JRch6DTWTrSaV/w0="}]},"_npmUser":{"name":"168bj4","email":"168bj4@gmail.com"},"directories":{},"maintainers":[{"name":"168bj4","email":"168bj4@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/analytics-mtm_0.1.0_1724996724183_0.987908202757386"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-11T07:25:10.836Z","modified":"2024-08-30T05:45:24.494Z","0.0.3":"2023-09-11T07:25:11.080Z","0.1.0":"2024-08-30T05:45:24.342Z"},"bugs":{"url":"https://github.com/168bj4/Analytics-Mtm/issues"},"author":{"name":"Scott Yen"},"license":"MIT","homepage":"https://github.com/168bj4/Analytics-Mtm","keywords":["analytics-mtm"],"repository":{"type":"git","url":"git+https://github.com/168bj4/Analytics-Mtm.git"},"description":"This plugin is used to install analytics matomo tag manager functions for frontend nuxt projects","maintainers":[{"name":"168bj4","email":"168bj4@gmail.com"}],"readme":"# Analytics\n\nThis plugin is used to install analytics functions for frontend nuxt projects, must used with /site.js included\n\n# Edit Plugin\n```\nnpm install && npm run build\nnpm publish\n```\n\n# Before Install\n\nMust check the /site.js is included.\n\nStep 1. For develop, you can create static/site.js as follow content. (Required)\n```\nvar _jsvar = {};\n_jsvar.siteId = 168;\n_jsvar.siteType = 'forum';\n_jsvar.siteLocale = 'zh_cn';\n_jsvar.siteAnalyticsUrl = '{{ matomo url }}';\n_jsvar.siteAnalyticsId = '{{ matomo tag manager id }}';\nwindow._jsvar = _jsvar;\n```\n\nNUXT / Step 2. Install /site.js in nuxt.config (Required)\n```\n...\nscript: {\n...\n{ src: '/site.js' },\n...\n},\n,,,\n```\nVUE-CLI / Step 2. Create site.js in public/site.js (Required)\n\n# Registry Setup\n\n### \n```\n# Set URL for your scoped packages.\n# For example package with name `@frontend/analytics-mtm` will use this URL for download\nnpm config set @frontend:registry https://{{ analytics_domain }}/api/v4/packages/npm/\n\n# Add the token for the scoped packages URL. This will allow you to download\n# `@frontend/` packages from private projects.\n# You can find persion_token on your profile page, and replace the <your_token> as follow.\nnpm config set '//{{ analytics_domain }}/api/v4/packages/npm/:_authToken' \"<your_token>\"\n```\n\n# NUXT Setup\n\nAfter install the package, you should do things follow.\n\nStep 1. Create plugin file name plugins/analytics.js (Required)\n```\nimport Vue from 'vue';\nimport Analytics from '@frontend/analytics-mtm';\n\nVue.use(Analytics);\n\nexport default ({ app }) => {\n  const options = {\n    router: app.router,\n    user: app.store.state.user\n  }\n  Analytics.bind(options)\n};\n\n```\n\nStep 2. Setting analytics plugin in nuxt.config.js (Required)\n```\n...\n/*\n** Plugins to load before mounting the App\n** https://nuxtjs.org/guide/plugins\n*/\nplugins: [\n  ...\n  '@/plugins/analytics',\n],\n...\n\n```\n\nStep 3. On the page you want to track some event (Optional)\n```\nimport Tracker from '@frontend/analytics-mtm';\n\n## Example\n\nTracker.event('Envelope', 'click', 'button1', 1000);\n\n```\n\n# VUE-CLI Setup\n\nAfter install the package, you should do things follow.\n\nStep 1. Create file name src/analytics.js (Required)\n```\nimport router from './router'\nimport store from './store'\nimport Analytics from '@frontend/analytics-mtm'\n\nAnalytics.init()\nconst options = {\n  router: router,\n  user: store.getters.userInfo\n}\nAnalytics.bind(options)\n\n```\n\nStep 2. Setting analytics import in src/main.js (Required)\n```\n...\nimport './analytics' // import analytics plugin\n...\n\n```\n\nStep 3. On the page you want to track some event (Optional)\n```\nimport Tracker from '@frontend/analytics-mtm';\n\n## Example\n\n/**\n  * Example {'Event8  Name', data}\n  * data: {\n  *   key: value,\n  *   key2: value2,\n  *   key3: [],\n  * }\n  */\n\n```","readmeFilename":"README.md"}