{"_id":"@analytics-debugger/google-tag-linker","_rev":"1-d3484398a49c8c7ee5b08a9912a65b2d","name":"@analytics-debugger/google-tag-linker","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1-beta":{"name":"@analytics-debugger/google-tag-linker","version":"0.0.1-beta","description":"Generate a cross-domain linker parameter for Google Tags ( ie: Google Analytics 4 )","main":"dist/googleTagLinker.min.js","module":"dist/dist/googleTagLinker.esm.min.js","browser":"dist/googleTagLinker.min.js","devDependencies":{"jest":"^26.6.3"},"scripts":{"build":"rollup -c","dev":"rollup -c --watch","test":"jest","devtest":"jest --watch","prepublish:patch":"npm version patch --force && npm run build","prepublish:minor":"npm version minor --force && npm run build","prepublish:major":"npm version major --force && npm run build","publish:public":"npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/analytics-debugger/google-tag-linker.git"},"keywords":["google","google tag","cross-domain","linker","google tag manager","google analytics","ga4","analytics"],"author":{"name":"David Vallejo","email":"thyngster@gmail.com","url":"https://www.thyngster.com"},"license":"MIT","bugs":{"url":"https://github.com/analytics-debugger/google-tag-linker/issues"},"homepage":"https://www.thyngster.com","funding":{"type":"individual","url":"https://ko-fi.com/thyngster"},"dependencies":{"@babel/core":"^7.19.6","@babel/plugin-transform-object-assign":"^7.18.6","@babel/preset-env":"^7.19.4","@rollup/plugin-node-resolve":"^15.0.1","rollup":"^2.79.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-license":"^3.0.1","rollup-plugin-terser":"^7.0.2"},"_id":"@analytics-debugger/google-tag-linker@0.0.1-beta","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-YURzI+8136bEtFDf9ZzEaJa1HSNgWXfKYlWuhtg6ModGV9g8V7xY2eXhD9e7wK2D3kTEyJzrog15piLh10sHRg==","shasum":"9db7e1e0cb5d35fcb0ec34a4c88429a4a20cf0b9","tarball":"https://registry.npmjs.org/@analytics-debugger/google-tag-linker/-/google-tag-linker-0.0.1-beta.tgz","fileCount":11,"unpackedSize":36670,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDUMFCDbuxymbjzBf26ZP6XXZ5919RorjW+UNX31gS26QIgUHKF4LD3fL8YjRKa2kaPlBhbnJXq7cKHsu+d/58Ml8M="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjYwvvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoihAAkMLhf3J94BejZE1pr8/w8wOlTmrI8P0ZInsKE+uAmpN2laIy\r\nPbr0M6z4NvVLgoBE+/Z36Nr2dVX/JEfWLmSAU8fUblvYjC3oLOgBb5NaKNfQ\r\nP1bJySEd0JI5bQN4Ah/23Gpqtfm8iX/3Xm4XiKBNqlrxwSfHU5WjrIC3fj71\r\n+HFURgitTigRtS3lXMNKaSrAnF78OacQmZ0FKW789pRvGAew9Ejk2o2+yltq\r\nN5nc6/24UYCVeBQlDBTsfiJ9OLzh1Ofku6KEVKqQwD0nYr7O11481Q6kgx0R\r\nS8PIuJ1OykD2pZHGKCeUB8gs/GaJVRIf5kidy62dnITIgDLB2dalf+DJMB4j\r\nMq9WmbmbJ1R4VS8Tc0i35iL081Blz4KukxK7aqO7Q/oZYwZ3ifTFbFaW/gZ4\r\nxBojgd3KtmA4uX90F4UXHxBQzK+FfhedA/j1QReZIdh4S7z+7hCbeCrwqxVb\r\nUqqNAgl+GQYJLYyl5y4EHieDhTsUdgiuRteNJDGPwpPySkaUA2pLnDTvgn3J\r\nPXSpG+W+gU1oKFTBxLvEh34D08jVFQLCqah0dhoqeal8Hb/DcJMURT2kehdE\r\nzW8K2lz4JTzADy2nvD9H+7Bwh+WkvJ2bhGzfKfbVmOP5hQKwEBOGcYv7Ywuj\r\nQp+V6Hs6wlzLkXwL3S03NVFgk7bxlrX9/dE=\r\n=9okS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"thyngster","email":"thyngster@gmail.com"},"directories":{},"maintainers":[{"name":"thyngster","email":"thyngster@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/google-tag-linker_0.0.1-beta_1667435503133_0.57379540582626"},"_hasShrinkwrap":false},"0.0.1":{"name":"@analytics-debugger/google-tag-linker","version":"0.0.1","description":"Generate a cross-domain linker parameter for Google Tags ( ie: Google Analytics 4 )","main":"dist/googleTagLinker.min.js","module":"dist/dist/googleTagLinker.esm.min.js","browser":"dist/googleTagLinker.min.js","devDependencies":{"jest":"^26.6.3"},"scripts":{"build":"rollup -c","dev":"rollup -c --watch","test":"jest","devtest":"jest --watch","prepublish:patch":"npm version patch --force && npm run build","prepublish:minor":"npm version minor --force && npm run build","prepublish:major":"npm version major --force && npm run build","publish:public":"npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/analytics-debugger/google-tag-linker.git"},"keywords":["google","google tag","cross-domain","linker","google tag manager","google analytics","ga4","analytics"],"author":{"name":"David Vallejo","email":"thyngster@gmail.com","url":"https://www.thyngster.com"},"license":"MIT","bugs":{"url":"https://github.com/analytics-debugger/google-tag-linker/issues"},"homepage":"https://www.thyngster.com","funding":{"type":"individual","url":"https://ko-fi.com/thyngster"},"dependencies":{"@babel/core":"^7.19.6","@babel/plugin-transform-object-assign":"^7.18.6","@babel/preset-env":"^7.19.4","@rollup/plugin-node-resolve":"^15.0.1","browser-or-node":"^2.0.0","rollup":"^2.79.1","rollup-plugin-babel":"^4.4.0","rollup-plugin-license":"^3.0.1","rollup-plugin-terser":"^7.0.2"},"gitHead":"4645fe9ec900140932f1b96d421d3daa6dba8252","_id":"@analytics-debugger/google-tag-linker@0.0.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-MJzKjwY0r0kCTGnUhk9CeStI0O3DTalZSKcCmTYfqfzi0Mk73lQVwQc3+tiA2XfBdhJTQEQ+0xNPoN5ta27m/Q==","shasum":"fb1c88fde04382083a11b08747fea9c11d33800e","tarball":"https://registry.npmjs.org/@analytics-debugger/google-tag-linker/-/google-tag-linker-0.0.1.tgz","fileCount":11,"unpackedSize":23568,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAbNdB4iPVCufLQzcVMwPxcA9b0sblh8HXlSRaBda3rlAiAlq3ASGHoNtTUuwdY95HO2ECq1ktkgxCUT8HmPSlOs/g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjY8jUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpShg/+ILflrqwD1v8solw/RSYRVy5ERO71kcjkIadeqBy0jrOvMGSF\r\nDWN9nqHqoei0gexcu6NjRqqmi1/rgeY2s06aTuhZfD1rKmNW/WQjZ/3iglkK\r\nL7CKLwIKvGI91G523bFMZuUtJClIBj92tkfPX7MrBRmYoYnjjAz3XFcxepBy\r\nzUNXXyYOac4B1JrGjgXuqbbGWvcSUytcQMS3vR4AMSmj3XqeJl8cs/b63hEA\r\nyBXZWLZ+MUyi2n5scv1r2ccuihQCjBatX1Zl10ipXdpi0X9v641rCMd2fwXt\r\nx593sMV6dOetMKxFdQUoq130GCpaAgPz6CxLGJ1BO7Er7TzBZwig6jgVk9Kq\r\no1kHcbZ0k6F0YUTuCY2jE2u1yz0U+pCP4q/Vzkp0h+bGdve8jkq771QDYUmn\r\nKTbxqUu5jBkqVY+3mKoTuD8qvGdLDdYUcZIj7Wa+Du+ZN5jZA7uIubLIty7S\r\navG8LK13k/XTqFFFMNwp235Hec58c4dA86NSx/ob4iUeaCROMS+nEJU3G1c2\r\nfmTgcbam1f9AiONISP5SQVesSL0mIH7mWJt91y8S1t8bRAktkO6suc99m0uH\r\narlD6tJ4GbUw3lbVCbwSEmUkzA31Qkt/h+QSC874LfKnDQks0L2lr2kcbzDX\r\nkay5YJu+uANYfZipWHIrsv7pXPrEI3pRX9Y=\r\n=xxZU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"thyngster","email":"thyngster@gmail.com"},"directories":{},"maintainers":[{"name":"thyngster","email":"thyngster@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/google-tag-linker_0.0.1_1667483860128_0.7091812146096532"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-03T00:31:43.076Z","0.0.1-beta":"2022-11-03T00:31:43.327Z","modified":"2022-11-03T13:57:40.365Z","0.0.1":"2022-11-03T13:57:40.283Z"},"maintainers":[{"name":"thyngster","email":"thyngster@gmail.com"}],"description":"Generate a cross-domain linker parameter for Google Tags ( ie: Google Analytics 4 )","homepage":"https://www.thyngster.com","keywords":["google","google tag","cross-domain","linker","google tag manager","google analytics","ga4","analytics"],"repository":{"type":"git","url":"git+https://github.com/analytics-debugger/google-tag-linker.git"},"author":{"name":"David Vallejo","email":"thyngster@gmail.com","url":"https://www.thyngster.com"},"bugs":{"url":"https://github.com/analytics-debugger/google-tag-linker/issues"},"license":"MIT","readme":"# Google Tag Linker Brigde\n\nHola! This is a **JavaScript** library that provided the needed functionality for creating a linkParam for Google analytics 4 ( ***`Google Tag`*** , ***`GTAG`*** ) . I started this work back in 2019 when I first saw the new `_gl` parameter.\n\nAt the time of publishing this library Google doesn't offer any \"documented\" way of generating this value, making really hard to work with custom implementations, for example when needing to deal with iFrames or forms/links generated dynamically. \n\nThe library is provided in the `AMD`, `UMD`, `IIFE` and `ESM` formats, all of them available in the `dist` folder\n\n# How does Google Tag cross-domain work\n\nGoogle Tag cross-domain works pretty similarly to how previous Google Analytics worked. It's basically based on 2 different parts. \n\n1. A Fingerprint (Browser/Time)\n2. The List of Cookies to be passed to the new domain\n\nThe finger printing is done using the following values:\n\n - Navigator User Agent\n - User Timezone\n - Navigator Language\n - Current Time ( current inute index from EPOC TimeStamp Rounded )\n - A list of cookies passed on the linker\n\nThe usage for this fingerprinting is not identifying the user but making the current link only to work on the current user browser and making it valid only for the current minute ( since many users may share the same browser specs )\n\nThe Linker Paramter will look like this:\n\n    1*dm649n*[_ga*MTM2MDM4NDg1MS4xNjYxODIxMjQy]*[_ga_THYNGSTER*XXXXXXXXXXXXXXX]\n\n   \nWhich follows the following definition\n    \n    {{FIXED_NUMBER}}*{{FINGERPRINT_HASH}}*[COOKIE_KEY*COOKIE_VALUE]^n\n\nNote that Google Tag allow allows to do an AdWords / DoubleClick cookies. Which are not currently supported by this tool, yet ...\n\nThis tool will read and pass the following cookies by default:\n\n|Cookie Name|Description|\n|--|--|\n|_ga|Universal and Google Analytics 4 Cookie|\n|_ga_XXXXXX|Google Analytics 4 Session Cookie|\n|FPLC|First Party Linker Cookie . SGMT COOKIE|\n\n# Notes\nThis is a beta version, while it should work fine for doing a GA4 cross-domain tracking, some features needs to in a future, check next section.\n\nCross Domain has not been properly checked when there're multiple GA4 Session cookies\n\n# To-Do\n\n - Add Adwords / Double Click Support\n - QA environments with multiple cookies\n - Add the chance to manually defined the cookies to be passed\n - Add a \"read\" method to decode the linkerParam to the real cookie values\n - Add a \"decorate\" method\n - Add tests\n - Refactoring / TypeScript\n\n# Build\n> $ npm install\n> $ npm run build\n  \n\n# How to use\nAfter loading the script just run the following. \n\nUsing Import:\n\n\n    import googleTagLinker from '@analytics-debugger/google-tag-linker'\n    const linkerParam  = googleTagLinker(\"get\");\n\nor loading the IIFE version:\n\n    <script src=\"https://cdn.jsdelivr.net/npm/@analytics-debugger/google-tag-linker@latest/dist/googleTagLinker.iife.min.js\"><script>\n    <script>\n    const linkerParam  = googleTagLinker(\"get\");\n    </script>\n\n","readmeFilename":"README.md"}