{"_id":"@dreamonkey/quasar-app-extension-tracking","_rev":"2-0db675b237da991f78eaae5495142512","name":"@dreamonkey/quasar-app-extension-tracking","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@dreamonkey/quasar-app-extension-tracking","version":"0.1.0","description":"Provide composables to add multiple tracking scripts via Quasar Meta plugin","keywords":["quasar","tracking","facebook","pixel","google","analytics","tag manager","linkedin","insight tag"],"author":{"name":"Paolo Caleffi","email":"p.caleffi@dreamonkey.com"},"license":"MIT","main":"dist/exports.js","types":"dist/exports.d.ts","scripts":{"build":"rimraf dist && tsc --declaration","install-build-clean":"yarn install && yarn build && rimraf node_modules","test":"echo \"No test specified\" && exit 0","deploy":"yarn build && yarn publish --tag latest"},"repository":{"type":"git","url":"https://github.com/dreamonkey/quasar-app-extension-tracking"},"bugs":{"url":"https://github.com/dreamonkey/quasar-app-extension-tracking/issues"},"homepage":"http:","devDependencies":{"@babel/types":"^7.15.6","@types/node":"^12.20.27","quasar":"^2.6.6","rimraf":"^3.0.2","typescript":"^4.6.4","vue":"^3.2.33"},"peerDependencies":{"quasar":"^2.0.0","vue":"^3.2.0"},"engines":{"node":">= 12.2.0","npm":">= 5.6.0","yarn":">= 1.6.0"},"publishConfig":{"access":"public"},"licenseText":"MIT License\n\nCopyright (c) 2022 Dreamonkey S.r.l.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dreamonkey/quasar-app-extension-tracking@0.1.0","dist":{"shasum":"b8a256266951a0c6ab44cf79afdf2adf32183f09","integrity":"sha512-3lJkBZD2efpcBXgJVZU7C7cKc/EffKsUU432f2G+kwwooDz5x12nowwDSfI2hvQx9rERI24YTShnDPTPfNaGgA==","tarball":"https://registry.npmjs.org/@dreamonkey/quasar-app-extension-tracking/-/quasar-app-extension-tracking-0.1.0.tgz","fileCount":29,"unpackedSize":13678,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEG8TzNmWnyeyxL+jNz4iVszD+kWm1aVLseEUDIauqrwAiAlAEuRDeAG0SXgGTEp5FeKorP1EJOG+fomll0M0SbTyg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidTcNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1TA//eMNIu+bDgTlNMdmp4RxID5e9c93XMNY4ysjrRjkxKl1qv3Xw\r\nydchrWLcC1vJoK73efsiDEYqNmGf6ghuBB4sm+XiO1DgSqIIMDkjE80XnoGi\r\naCK5B0BxC56P75vokCvqjkgx6SiByEQS6Bsjao24hdmgl1MIiL4zz/q44u51\r\nIsjimEEeI048EX9HVql9nMJT20j2iKpDhzVfPLYbFmyeBNe4LQ5ym7ffBfgV\r\n8mNmh9Zokde2IVpPlioLTC0CttZC9ZYT7KE8EMjuwN/YwuXkKhxvy6iVUxSJ\r\nopnizkq7QN2wtok7byeLNgfuAangN5Rin0gKXOLNyoatN0R8WlfYCPI7bHkm\r\nukQATdQzAwG3z1syuZQZJInM6L8wvFsUtf+fNb7eY7xzWRRVUJrxWERQtDlr\r\n9kpPupWXdpJt6WIBT+bAW6xuBu8DxljUpCyejyuGTAUBVcbQay9ANj0tqOIc\r\nkIZb4IvoXf/uolP+c5xyZWzTcw9iSXa7pj8HWCxVglq1TqGgSuV0jpgiaW/i\r\ntBXPTL4Kc5BVDW6FjxmXlTyLnUn0qeXOw0YjDRAOsLDQwP/4Z5fEUBYTpa/z\r\nPvxdibEdOQtJYRZWVApl0KnzYxwufmCi+19IvbgF7/kpc4NRbJVMYLbIFo8e\r\nB0CUbDFePGvKrI2F9mCRM/w4quo8WdmL4U0=\r\n=0H6A\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},"directories":{},"maintainers":[{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},{"name":"mrkappa","email":"k.borghi@dreamonkey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quasar-app-extension-tracking_0.1.0_1651848972966_0.4570662244655528"},"_hasShrinkwrap":false},"0.1.1":{"name":"@dreamonkey/quasar-app-extension-tracking","version":"0.1.1","description":"Provide composables to add multiple tracking scripts via Quasar Meta plugin","keywords":["quasar","tracking","facebook","pixel","google","analytics","tag manager","linkedin","insight tag"],"author":{"name":"Paolo Caleffi","email":"p.caleffi@dreamonkey.com"},"license":"MIT","main":"dist/exports.js","types":"dist/exports.d.ts","scripts":{"build":"rimraf dist && tsc --declaration","install-build-clean":"yarn install && yarn build && rimraf node_modules","test":"echo \"No test specified\" && exit 0","deploy":"yarn build && yarn publish --tag latest"},"repository":{"type":"git","url":"https://github.com/dreamonkey/quasar-app-extension-tracking"},"bugs":{"url":"https://github.com/dreamonkey/quasar-app-extension-tracking/issues"},"homepage":"http:","devDependencies":{"@babel/types":"^7.15.6","@types/node":"^12.20.27","quasar":"^2.6.6","rimraf":"^3.0.2","typescript":"^4.6.4","vue":"^3.2.33"},"peerDependencies":{"quasar":"^2.0.0","vue":"^3.2.0"},"engines":{"node":">= 12.2.0","npm":">= 5.6.0","yarn":">= 1.6.0"},"publishConfig":{"access":"public"},"licenseText":"MIT License\n\nCopyright (c) 2022 Dreamonkey S.r.l.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dreamonkey/quasar-app-extension-tracking@0.1.1","dist":{"shasum":"6d367165132f17e616d9a3168224c79208bc39ea","integrity":"sha512-Q59jMjRKCGkEphDbSd/8J9XLsua/mYoFlsGVNYAi5lqLcR/dx8ydzk6Zfdk3rve9SrSoPDv67PLVS1fSw9Nu7Q==","tarball":"https://registry.npmjs.org/@dreamonkey/quasar-app-extension-tracking/-/quasar-app-extension-tracking-0.1.1.tgz","fileCount":29,"unpackedSize":13991,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCz4KIsxEzyJqsYxidDuTyfdD4T/nAutVyS6MlnOmbrSgIgHDB+9VTEAsa+yxcM9OPmoeM9M8iwnI9nkCOcK2OQEy0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJidTx+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrY6RAAgt6NfYPD6ukXl8S4kG0qRhR4o7EnRhMrKZYaiMvuKVfky7kE\r\nYCl12J5C1Pey2WTIZ5TUa1iOWDtfCZMly2Q/bxeLL1N/UmqFH5hEs6JiDf/1\r\nnCyBFneR84UE7ryyNFuAFV6QwpOXN3Yfp3H6bIvwbVdiQpwAQZ6g2q4FUsQk\r\nwI53vxkO5wvC0AdX1SgcVOzwB18ZxwqKyQ0BhEvHxE4ooYSzBIVCf/I2QMcL\r\n1qSyeuOFRqzw83hee2bFDIRKUwQ9edXhdjmKrIYoTxC3QfhMLI40wC/9TCZm\r\nc9BuDz+cOgwlJWluoQ8PD5Kc1Cx13SDW3EJJ2QgVek95b9hw0d/HtzPHptR4\r\nQk++TVWmY4Ofd4uUJuR+TYVu6g9DbLtXzjPFnpO3LkKqGQ8a2LcFLoqTNofj\r\nUvHQDabarWxyVjQ5fmxsn4cf7ACkcNCaqnGWhqf8UV6v2562JsDo4UJ+Qo+Q\r\nHwxOB5LqkgNEaFPF7TIQOmQqU7ztsPVARQC1py9wt0duL9hFJxTkqniHTE5X\r\nn/i2cHz0PYkQEpK0uvwRpbmfc+tQqZ2/G/t4+W8v9jgvVpeakI6MwUxJAPYo\r\nuc7UfHXioHL1usLHYEglyleMjHGsiXkOvwVf8F0GE81/uz2w9FV1KRqxlHuf\r\nAq1fOCU3RSpu5ssASsvcrgfR4tYN49yHwuQ=\r\n=qjXB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},"directories":{},"maintainers":[{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},{"name":"mrkappa","email":"k.borghi@dreamonkey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quasar-app-extension-tracking_0.1.1_1651850366231_0.4236340359991715"},"_hasShrinkwrap":false},"0.1.2":{"name":"@dreamonkey/quasar-app-extension-tracking","version":"0.1.2","description":"Provide composables to add multiple tracking scripts via Quasar Meta plugin","keywords":["quasar","tracking","facebook","pixel","google","analytics","tag manager","linkedin","insight tag"],"author":{"name":"Paolo Caleffi","email":"p.caleffi@dreamonkey.com"},"license":"MIT","main":"dist/exports.js","types":"dist/exports.d.ts","scripts":{"build":"rimraf dist && tsc --declaration","install-build-clean":"yarn install && yarn build && rimraf node_modules","test":"echo \"No test specified\" && exit 0","deploy":"yarn build && yarn publish --tag latest"},"repository":{"type":"git","url":"https://github.com/dreamonkey/quasar-app-extension-tracking"},"bugs":{"url":"https://github.com/dreamonkey/quasar-app-extension-tracking/issues"},"homepage":"http:","devDependencies":{"@babel/types":"^7.15.6","@types/node":"^12.20.27","quasar":"^2.6.6","rimraf":"^3.0.2","typescript":"^4.6.4","vue":"^3.2.33"},"peerDependencies":{"quasar":"^2.0.0","vue":"^3.2.0"},"engines":{"node":">= 12.2.0","npm":">= 5.6.0","yarn":">= 1.6.0"},"publishConfig":{"access":"public"},"licenseText":"MIT License\n\nCopyright (c) 2022 Dreamonkey S.r.l.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@dreamonkey/quasar-app-extension-tracking@0.1.2","dist":{"shasum":"8813c4b16e8f6b92843d04fd361ebee2f9a87be7","integrity":"sha512-Ki3vKZucmihLymetH4X8uVzk2y37PZer/L3XDXoQxsWa8uimknj0e3f25UIt3Kag/b1/RWzbZQeljGoF0bvOiw==","tarball":"https://registry.npmjs.org/@dreamonkey/quasar-app-extension-tracking/-/quasar-app-extension-tracking-0.1.2.tgz","fileCount":29,"unpackedSize":18983,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF6lj8NWIfffXC+RKNREn96IVurA0ULcjF67H/d/0cqlAiEArcjfr/1Qbyh8DYE44lmOdxXXYWG5juRO59RZyWDJoY4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiek58ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSMw//SbrxydQzVIYDuoOZiuw9bc85gUqVAqLL0T9ebTxN6TOrFCwt\r\nLFXgwcNcUzc4UzLu9tKIA8Y0sGJdqz9cKKnT7VTC3WoMfFShOTCgWYdlU+In\r\nQYVuSYYaedt8G6v5yltosUpFdWda2HjZKFXILkXaYooxjoj/yMlYwBSgS84P\r\nLteROof14AlL+zhdinx0GLQjYbWT4Y94tfXoU/cZ2niy29v0IIiVLhKM/WEG\r\nyCwNPdmM3Pt/JjBaUSCcPjKlgi6tb33N7Urxk+oL9CVNhrEwCcpYZceI87QC\r\nw+1ywbc7l46t9s59+DEHQM5vynPDV7+KAxBQrVBG/SuzY+AdSf5oPM9CLQ/a\r\n63Jl5So96mK6md1oH13Fzr1K2jdauejDW+AcjwKfJeSWEb2jVZDLlF2xZBoW\r\ns/h3RufMIug/HZqDIc1Au6RdaTGw/Tx7uwR1S4UklqH7dWRi0TLkYdCQiDP8\r\nGfwUPOcTWeHN5zjj5pD0BFaPo6w2Z5Ibr3TM6QflcNvwA6AvMo//uJ+W3mlV\r\nSzqM/ffTGhmrHRFTIfrExbG2im+0Udm91NL90UJ264cAdYq0lb96tgQgQjrT\r\nLIgwBZDNhjAplTQ69MvAFutWbv/3Qfo0UX1TYm9IO5kV9LsdzRXHdOdAFnsU\r\nPO+lgpC9B6zIgL9BsFoVd2wcjz3kmrL9G+s=\r\n=vwt6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},"directories":{},"maintainers":[{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},{"name":"mrkappa","email":"k.borghi@dreamonkey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/quasar-app-extension-tracking_0.1.2_1652182652744_0.8572705507415157"},"_hasShrinkwrap":false}},"time":{"created":"2022-05-06T14:56:12.901Z","0.1.0":"2022-05-06T14:56:13.127Z","modified":"2022-05-10T11:37:33.030Z","0.1.1":"2022-05-06T15:19:26.429Z","0.1.2":"2022-05-10T11:37:32.922Z"},"maintainers":[{"name":"ilcallo","email":"p.caleffi@dreamonkey.com"},{"name":"mrkappa","email":"k.borghi@dreamonkey.com"}],"description":"Provide composables to add multiple tracking scripts via Quasar Meta plugin","homepage":"http:","keywords":["quasar","tracking","facebook","pixel","google","analytics","tag manager","linkedin","insight tag"],"repository":{"type":"git","url":"https://github.com/dreamonkey/quasar-app-extension-tracking"},"author":{"name":"Paolo Caleffi","email":"p.caleffi@dreamonkey.com"},"bugs":{"url":"https://github.com/dreamonkey/quasar-app-extension-tracking/issues"},"license":"MIT","readme":"# @dreamonkey/quasar-app-extension-tracking\n\nThis is a [Quasar App Extension (AE)](https://quasar.dev/app-extensions/introduction#Introduction)\nIt provides composables for many commonly used tracking scripts using [Quasar Meta Composable](https://quasar.dev/vue-composables/use-meta).\n\n- Google Tag Manager -> `useGoogleTagManager`\n- Facebook Pixel -> `useFacebookPixel`\n- Linkedin Insight Tag -> `useLinkedinInsightTag`\n\nWe'll gladly accept other contributions.\n\n# Install\n\n```bash\nquasar ext add @dreamonkey/tracking\n```\n\n# Uninstall\n\n```bash\nquasar ext remove @dreamonkey/tracking\n```\n\n# Usage\n\nComposables are meant to be placed into your layout components, as you usually want them to be triggered each time a user land on any of your pages.\nAll composables accept an id/key, either as a plain string or as a ref.\nWhen using a ref, the script won't be added when its value is an empty string, undefined or any falsy value.\n\n**Scripts won't be added at all when compiling the app in development mode (eg. when running `quasar dev`)**\n\n```ts\n// src/layouts/main-layout.vue\n\nimport {\n  useGoogleTagManager,\n  useLinkedinInsightTag,\n} from \"@dreamonkey/quasar-app-extension-tracking\";\n\nexport default {\n  name: \"MainLayout\",\n  setup() {\n    // Add Google Tag Manager script\n    useGoogleTagManager(\"GTM-XXXXXXX\");\n\n    const linkedinId = ref();\n    // Won't add the Linkedin Insight Tag script since the provided ref has undefined value\n    useLinkedinInsightTag(linkedinId);\n\n    // Tracking AE will react to the change and add Linkedin Insight Tag script\n    linkedinId.value = \"XXXXXXX\";\n  },\n};\n```\n\n## Helpers\n\nWe provide some helpers to make your life easier.\n\n### `logGoogleTagManagerEvent`\n\nYou can use this helper to log an event to Google Tag Manager.\nWe don't make assumption about the event name nor data, but you must assure that the event name is a valid Google Tag Manager event name.\nThe first time you log an event we generate a unique id which identifies the session.\nThe id is then saved into the browser local storage and automatically attached to each event as a `cid` property.\n\n```ts\n// Send a lead generation event\nlogGoogleTagManagerEvent(\"leadGeneration\", {\n  leadId: \"12345\",\n});\n\n// { event: \"leadGeneration\", leadId: \"12345\", cid: \"XXXX-XX...XXX\" }\n```\n\nFor SPA websites or SSR/SSG with SPA takeover, Google Tag Manager will only catch the first PageView event.\nTo record all page views of subsequent navigations, you need to [create an ad-hoc custom event](https://fullstack-tutorials.com/quasar-framework/quasar-framework-google-tag-manager-and-analytics-setup-for-an-spa-website) on Google Tag Manager and use router's `afterEach` hook to fire it upon navigation.\n\n```ts\n// main-layout.vue - setup()\n\n// Send a page view event each time the user navigate\nconst router = useRouter();\nrouter.afterEach((to) => {\n  logGoogleTagManagerEvent(\"customPageView\", {\n    path: to.path,\n  });\n});\n\n// { event: \"customPageView\", path: \"/homepage\", cid: \"XXXX-XX...XXX\" }\n```\n\nIn case you need to provide the page title too and you're using Quasar Meta Composable to update it accordingly to the loaded page, remember that Vue-Router isn't aware of that change and you'll need to add a delay to let the update occour.\n\n```ts\n// main-layout.vue - setup()\n\n// Send a page view event each time the user navigate\nconst router = useRouter();\nrouter.afterEach(async (to) => {\n  // Wait for Meta plugin to kick in and update the document title\n  await new Promise((resolve) => setTimeout(resolve, 500));\n  logGoogleTagManagerEvent(\"customPageView\", {\n    path: to.path,\n    title: document.title,\n  });\n});\n\n// { event: \"customPageView\", path: \"/homepage\", title: \"Homepage - My Website\",  cid: \"XXXX-XX...XXX\" }\n```\n\nYou can also use Google Tag Manager [\"History Change\" listener](https://www.analyticsmania.com/other-posts/single-page-applications-with-universal-analytics-and-google-tag-manager/) instead.\n\n# Similar work\n\n- https://github.com/gtm-support/vue-gtm: much more complete on GTM side, we may copy over some features at some point\n\n# Donate\n\nIf you appreciate the work that went into this App Extension, please consider [donating to Dreamonkey](https://github.com/sponsors/dreamonkey).\n","readmeFilename":"README.md"}