{"_id":"@aidinabedi/ga4mp","_rev":"2-78eb4bd41b4f213c66757c50611a3d10","name":"@aidinabedi/ga4mp","dist-tags":{"latest":"0.0.11"},"versions":{"0.0.9":{"name":"@aidinabedi/ga4mp","version":"0.0.9","keywords":["google","google tag","gtag","ga4","google analytics 4","server side","ga4","analytics","measurement protocol"],"author":{"url":"https://www.thyngster.com","name":"David Vallejo","email":"thyngster@gmail.com"},"license":"MIT","_id":"@aidinabedi/ga4mp@0.0.9","maintainers":[{"name":"aidinabedi","email":"aidinabedi@gmail.com"}],"homepage":"https://github.com/aidinabedi/ga4mp/","bugs":{"url":"https://github.com/aidinabedi/ga4mp/issues"},"dist":{"shasum":"be77b4c48545a7c0eaa22145c118055da682f61c","tarball":"https://registry.npmjs.org/@aidinabedi/ga4mp/-/ga4mp-0.0.9.tgz","fileCount":14,"integrity":"sha512-ngvyyOfjLnUNc3lT42vgrbAvoBP420cVOBSNM/wmgI/1CYqL+W6LvRzA57gIn1AinHEIDCfo/sXiXAvaqzfdxQ==","signatures":[{"sig":"MEYCIQCTZS8Wk1tMVGPaWx4EiN9UPmWA8ddGko6NKJts3osiHQIhAOcr55Sr+tI36b0bg48WKOtCEM77S0qkaEwLASEJfy4F","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148741},"main":"dist/ga4mp.js","types":"dist/ga4mp.d.ts","module":"dist/ga4mp.esm.min.js","browser":"dist/ga4mp.min.js","gitHead":"b06e68214bd2f45b0152ded4b11ddcc2fc9022dc","scripts":{"dev":"rollup -c --watch --bundleConfigAsCjs","test":"jest","build":"rollup -c --bundleConfigAsCjs","devtest":"jest --watch","publish:public":"npm publish --access public","prepublish:beta":"npm version prerelease --preid=beta && npm run build","prepublish:alpha":"npm version prerelease --preid=alpha && npm run build","prepublish:major":"npm version major --force && npm run build","prepublish:minor":"npm version minor --force && npm run build","prepublish:patch":"npm version patch --force && npm run build"},"_npmUser":{"name":"aidinabedi","email":"aidinabedi@gmail.com"},"repository":{"url":"git+https://github.com/aidinabedi/ga4mp.git","type":"git"},"_npmVersion":"10.9.0","description":"An Open-Source Google Analytics 4 Client-Side Protocol Implementation","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","rollup":"^3.7.1","typescript":"^5.7.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","rollup-plugin-dts":"^6.1.1","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-terser":"^0.2.0","rollup-plugin-license":"^3.0.1","@rollup/plugin-node-resolve":"^15.0.1","@babel/plugin-transform-object-assign":"^7.18.6"},"_npmOperationalInternal":{"tmp":"tmp/ga4mp_0.0.9_1739485593274_0.7025862648613785","host":"s3://npm-registry-packages-npm-production"}},"0.0.10":{"name":"@aidinabedi/ga4mp","version":"0.0.10","keywords":["google","google tag","gtag","ga4","google analytics 4","server side","ga4","analytics","measurement protocol"],"author":{"url":"https://www.thyngster.com","name":"David Vallejo","email":"thyngster@gmail.com"},"license":"MIT","_id":"@aidinabedi/ga4mp@0.0.10","maintainers":[{"name":"aidinabedi","email":"aidinabedi@gmail.com"}],"homepage":"https://github.com/aidinabedi/ga4mp/","bugs":{"url":"https://github.com/aidinabedi/ga4mp/issues"},"dist":{"shasum":"762cb720b857439e1f9d4e35a6eedbdc369bde76","tarball":"https://registry.npmjs.org/@aidinabedi/ga4mp/-/ga4mp-0.0.10.tgz","fileCount":14,"integrity":"sha512-wUI3aBlvgChnFYOlCA2O2r5gJaxFa2E+F1Kig7KRXqqJ5Gc89+ckgHrkEqEgLyjH7BozvVAuJUxj2W4bL7fZOQ==","signatures":[{"sig":"MEQCIHeNaZg41Hti1f35EHXh4h6sCSPV4+a+n24g7DSoBUwzAiABC3yxcq56/uRiyQetxATUyms9S5qwEtjXrtyTxCzEIg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":155802},"main":"dist/ga4mp.js","types":"dist/ga4mp.d.ts","module":"dist/ga4mp.esm.min.js","browser":"dist/ga4mp.min.js","gitHead":"27c5ca154ceae9bd6297b9d627342a1cf8e41d0a","scripts":{"dev":"rollup -c --watch --bundleConfigAsCjs","test":"jest","build":"rollup -c --bundleConfigAsCjs","devtest":"jest --watch","publish:public":"npm publish --access public","prepublish:beta":"npm version prerelease --preid=beta && npm run build","prepublish:alpha":"npm version prerelease --preid=alpha && npm run build","prepublish:major":"npm version major --force && npm run build","prepublish:minor":"npm version minor --force && npm run build","prepublish:patch":"npm version patch --force && npm run build"},"_npmUser":{"name":"aidinabedi","email":"aidinabedi@gmail.com"},"repository":{"url":"git+https://github.com/aidinabedi/ga4mp.git","type":"git"},"_npmVersion":"10.9.0","description":"An Open-Source Google Analytics 4 Client-Side Protocol Implementation","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","rollup":"^3.7.1","typescript":"^5.7.3","@babel/core":"^7.20.5","@babel/preset-env":"^7.20.2","rollup-plugin-dts":"^6.1.1","@rollup/plugin-json":"^6.0.0","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-terser":"^0.2.0","rollup-plugin-license":"^3.0.1","@rollup/plugin-node-resolve":"^15.0.1","@babel/plugin-transform-object-assign":"^7.18.6"},"_npmOperationalInternal":{"tmp":"tmp/ga4mp_0.0.10_1739713221749_0.9226454785928466","host":"s3://npm-registry-packages-npm-production"}},"0.0.11":{"name":"@aidinabedi/ga4mp","version":"0.0.11","description":"An Open-Source Google Analytics 4 Client-Side Protocol Implementation","types":"dist/ga4mp.d.ts","main":"dist/ga4mp.js","module":"dist/ga4mp.esm.min.js","browser":"dist/ga4mp.min.js","scripts":{"build":"rollup -c --bundleConfigAsCjs","dev":"rollup -c --watch --bundleConfigAsCjs","test":"jest","devtest":"jest --watch","prepublish:alpha":"npm version prerelease --preid=alpha && npm run build","prepublish:beta":"npm version prerelease --preid=beta && npm run build","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/aidinabedi/ga4mp.git"},"keywords":["google","google tag","gtag","ga4","google analytics 4","server side","ga4","analytics","measurement protocol"],"author":{"name":"David Vallejo","email":"thyngster@gmail.com","url":"https://www.thyngster.com"},"license":"MIT","bugs":{"url":"https://github.com/aidinabedi/ga4mp/issues"},"homepage":"https://github.com/aidinabedi/ga4mp/","devDependencies":{"@babel/core":"^7.20.5","@babel/plugin-transform-object-assign":"^7.18.6","@babel/preset-env":"^7.20.2","@rollup/plugin-babel":"^6.0.3","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-terser":"^0.2.0","jest":"^26.6.3","rollup":"^3.7.1","rollup-plugin-dts":"^6.1.1","rollup-plugin-license":"^3.0.1","typescript":"^5.7.3"},"_id":"@aidinabedi/ga4mp@0.0.11","gitHead":"535ea6f2432c7fd6685ca6e30f75357908a66c3c","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-OPHkSENHw7KNEc5AFTwHWFNzZdNiIb5WR2iNw+5FHEWuABqyA6UN8IrWpGhBkHgSNV+RBwE0JUosf2RGsB7w8w==","shasum":"5320f2e3b9382e5e7bf286d8293cbc77de296d26","tarball":"https://registry.npmjs.org/@aidinabedi/ga4mp/-/ga4mp-0.0.11.tgz","fileCount":14,"unpackedSize":154739,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDD5VcLAMF8Jw1pqo5LvoNO/LvU8WC9DxalWHMCcPA91QIgcqF/2WR1MpiOdwufVi5Gn4KKhoXsuCKr93elRHyfE08="}]},"_npmUser":{"name":"aidinabedi","email":"aidinabedi@gmail.com"},"directories":{},"maintainers":[{"name":"aidinabedi","email":"aidinabedi@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ga4mp_0.0.11_1739715660511_0.10414160455995103"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-13T22:26:33.162Z","modified":"2025-02-16T14:21:00.987Z","0.0.9":"2025-02-13T22:26:33.442Z","0.0.10":"2025-02-16T13:40:21.937Z","0.0.11":"2025-02-16T14:21:00.784Z"},"bugs":{"url":"https://github.com/aidinabedi/ga4mp/issues"},"author":{"name":"David Vallejo","email":"thyngster@gmail.com","url":"https://www.thyngster.com"},"license":"MIT","homepage":"https://github.com/aidinabedi/ga4mp/","keywords":["google","google tag","gtag","ga4","google analytics 4","server side","ga4","analytics","measurement protocol"],"repository":{"type":"git","url":"git+https://github.com/aidinabedi/ga4mp.git"},"description":"An Open-Source Google Analytics 4 Client-Side Protocol Implementation","maintainers":[{"name":"aidinabedi","email":"aidinabedi@gmail.com"}],"readme":"\r\n# GA4MP - Google Analytics 4 Measurement Protocol\r\n\r\nThis is an open-source implementation for the *client-side* protocol used by **Google Analytics 4**. When I mention \"**client-side**\" is because it must be differentiated with the official [GA4 Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/ga4) offered by Google.\r\n\r\nThis library implements the public **Google Analytics 4** protocol to make possible to do a full server-side tracking using NODE/JS which is not actually possible with the official **Measurement Protocol** , which is meant only to augment the current GA4 data and it's not ready for doing a full tracking.\r\n\r\nMain differences with the official offerser server-side protocol are:\r\n\r\n- Trigger new sessions and visits starts\r\n- Track Sessions attribution\r\n- Override the User IP to populate the GEO Details\r\n- View the hits on the DebugView\r\n- Override ANY value you want\r\n- Easily portable to other languages\r\n\r\nIf we compare this library with the official GTAG implementation.\r\n\r\n - Lightweight 8.7kb (<4kb compressed ) 95.6% Lighter than a GTAG Container\r\n![image](https://user-images.githubusercontent.com/1494564/201500771-f54c592b-4f37-4ac1-9a89-87878987cc33.png)\r\n - Privacy Compliant: Full control over which cookies are created/read and sent to Google\r\n - Dual Tracking (send hits to multiple measurement Ids)\r\n\r\n## Usage\r\n\r\n#### **ES6 Imports**\r\n\r\n    import  ga4mp  from  '@aidinabedi/ga4mp'\r\n    const  ga4track = ga4mp([\"G-THYNGSTER\"], {\r\n    \tuser_id:  undefined,\r\n    \tnon_personalized_ads:  true,\r\n    \tdebug:  true\r\n    });\r\n\r\n#### **Browser**\r\n<.script  src=\"https://cdn.jsdelivr.net/npm/@aidinabedi/ga4mp@latest/dist/ga4mp.umd.min.js\">< /script>\r\n\r\n    const  ga4track  =  ga4mp([\"G-THYNGSTER\"],  {\r\n    \tuser_id: undefined,\r\n    \tnon_personalized_ads: true,\r\n    \tdebug: true\r\n    });\r\n\r\n#### **NODE.JS**\r\n\r\n    const  ga4mp = require('./dist/ga4mp')\r\n    const  ga4track = ga4mp([\"G-THYNGSTER\"], {\r\n    \tuser_id:  undefined,\r\n    \tnon_personalized_ads:  true,\r\n    \tdebug:  true\r\n    });\r\n\r\n# More API details\r\nRead more at: https://ga4mp.dev/\r\n","readmeFilename":"README.md"}