{"_id":"@apriil-digital-oslo/rubics-gtm-events","_rev":"4-396e2d25bd1beeebcab8873b5afa4b74","name":"@apriil-digital-oslo/rubics-gtm-events","dist-tags":{"latest":"1.3.0"},"versions":{"1.0.0":{"name":"@apriil-digital-oslo/rubics-gtm-events","version":"1.0.0","author":"","license":"ISC","_id":"@apriil-digital-oslo/rubics-gtm-events@1.0.0","maintainers":[{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},{"name":"stianba","email":"stianba@gmail.com"},{"name":"tommyba","email":"tommy.bakkane@apriil.no"}],"homepage":"https://github.com/ludens-reklamebyra/rubics-gtm-events#readme","bugs":{"url":"https://github.com/ludens-reklamebyra/rubics-gtm-events/issues"},"dist":{"shasum":"7a7ecb23a130e9f571e9682d4fc959e8f80916eb","tarball":"https://registry.npmjs.org/@apriil-digital-oslo/rubics-gtm-events/-/rubics-gtm-events-1.0.0.tgz","fileCount":12,"integrity":"sha512-lApi43BLfDFzHOQgdLueZajTiNogZ0tFBnzVbo8IHoTzWzD+P9xbKwY2AA49GX+37ZIELp+xvAjZr8gbvrn+4Q==","signatures":[{"sig":"MEYCIQCKSQDfP4WSNfO8lqXvjZy6WcX8rE6yGrlUMOX3U8mwSwIhAO+CUF4TixkKrKYXeYvFl1u0eOIGnpKBN1gcLXcvX3zP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9400},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"7258e4ba7a9e181be11b07faacccdedaddfa2b46","scripts":{"test":"jest","build":"rm -rf ./dist && npx tsc","prepack":"npm run build","coverage":"jest --coverage","test:dev":"NODE_ENV=development jest --watchAll"},"_npmUser":{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},"repository":{"url":"git+https://github.com/ludens-reklamebyra/rubics-gtm-events.git","type":"git"},"_npmVersion":"10.8.2","description":"A tracking utility for Google Tag Manager","directories":{},"_nodeVersion":"20.18.3","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.7.3","@types/jest":"^29.5.14"},"_npmOperationalInternal":{"tmp":"tmp/rubics-gtm-events_1.0.0_1742195754268_0.45646098992486905","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@apriil-digital-oslo/rubics-gtm-events","version":"1.1.0","author":"","license":"ISC","_id":"@apriil-digital-oslo/rubics-gtm-events@1.1.0","maintainers":[{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},{"name":"stianba","email":"stianba@gmail.com"},{"name":"tommyba","email":"tommy.bakkane@apriil.no"}],"homepage":"https://github.com/ludens-reklamebyra/rubics-gtm-events#readme","bugs":{"url":"https://github.com/ludens-reklamebyra/rubics-gtm-events/issues"},"dist":{"shasum":"a73cb8f492ca69e164b81a8c22596667188680aa","tarball":"https://registry.npmjs.org/@apriil-digital-oslo/rubics-gtm-events/-/rubics-gtm-events-1.1.0.tgz","fileCount":12,"integrity":"sha512-VMd3hwMRzBvzL/x6a42rDzNTm+SOgQsJDWEEgmO1zpXJitbjwbwVC59vYGeZccgrYDiHCXHuiUZ0LnUflspVFg==","signatures":[{"sig":"MEUCIQCZ0m3tt5EC3F+Uib7Z1wikTS7Ldeog7CUCxUORgrm5PwIgJAs1qSWIwwd62WdnNxQx1WCGyeg7z17fyMhXCkJz3Vs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9427},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","gitHead":"ed0368f8453138429f8ebb1eebb8130acaabdee8","scripts":{"test":"jest","build":"rm -rf ./dist && npx tsc","prepack":"npm run build","coverage":"jest --coverage","test:dev":"NODE_ENV=development jest --watchAll"},"_npmUser":{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},"repository":{"url":"git+https://github.com/ludens-reklamebyra/rubics-gtm-events.git","type":"git"},"_npmVersion":"10.8.2","description":"A tracking utility for Google Tag Manager","directories":{},"_nodeVersion":"20.18.3","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.7.3","@types/jest":"^29.5.14"},"_npmOperationalInternal":{"tmp":"tmp/rubics-gtm-events_1.1.0_1742202947456_0.9168779293391167","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@apriil-digital-oslo/rubics-gtm-events","version":"1.2.0","author":"","license":"ISC","_id":"@apriil-digital-oslo/rubics-gtm-events@1.2.0","maintainers":[{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},{"name":"stianba","email":"stianba@gmail.com"},{"name":"tommyba","email":"tommy.bakkane@apriil.no"}],"homepage":"https://github.com/ludens-reklamebyra/rubics-gtm-events#readme","bugs":{"url":"https://github.com/ludens-reklamebyra/rubics-gtm-events/issues"},"dist":{"shasum":"ded0a6723c173963ade24506570a7633fa97fe83","tarball":"https://registry.npmjs.org/@apriil-digital-oslo/rubics-gtm-events/-/rubics-gtm-events-1.2.0.tgz","fileCount":12,"integrity":"sha512-rVHvVk+fyhneiHL6oi37nSX4wJxBqem7fvp+oVnmTI3SF5iJJnsdHRTD4cU74uMvPqjrXmp3NLIo5JjbChJTdw==","signatures":[{"sig":"MEQCIBGRAiDjVCzCducjH/bDA4lB1MRd566EVZgDKwrVA8glAiBUa8a1v4qk7jDdB4G+GxDMUnTNGThdqqUAFPkui5LsBw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9411},"main":"dist/index.js","type":"commonjs","types":"./dist/index.d.ts","gitHead":"3e6a710d27ebf30a862e0e0eb89fb1bd0f427d14","scripts":{"test":"jest","build":"rm -rf ./dist && npx tsc","prepack":"npm run build","coverage":"jest --coverage","test:dev":"NODE_ENV=development jest --watchAll"},"_npmUser":{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},"repository":{"url":"git+https://github.com/ludens-reklamebyra/rubics-gtm-events.git","type":"git"},"_npmVersion":"10.8.2","description":"A tracking utility for Google Tag Manager","directories":{},"_nodeVersion":"20.18.3","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.7.3","@types/jest":"^29.5.14"},"_npmOperationalInternal":{"tmp":"tmp/rubics-gtm-events_1.2.0_1742203377010_0.763180661708653","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@apriil-digital-oslo/rubics-gtm-events","version":"1.3.0","description":"A tracking utility for Google Tag Manager","type":"module","main":"dist/index.js","scripts":{"test:dev":"NODE_ENV=development jest --watchAll","test":"jest","coverage":"jest --coverage","build":"rm -rf ./dist && npx tsc","prepack":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/ludens-reklamebyra/rubics-gtm-events.git"},"author":"","license":"ISC","bugs":{"url":"https://github.com/ludens-reklamebyra/rubics-gtm-events/issues"},"homepage":"https://github.com/ludens-reklamebyra/rubics-gtm-events#readme","devDependencies":{"@types/jest":"^29.5.14","jest":"^29.7.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.7.3"},"_id":"@apriil-digital-oslo/rubics-gtm-events@1.3.0","gitHead":"25ce5d0497af7f5a3065aab4019eddf56340fe81","types":"./dist/index.d.ts","_nodeVersion":"20.18.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-pWq73HMsNuq58V+9mtz2J4RgihwA43/MjUFKn94I7FpQGcRvHnPF0Ohw+FqbZu+3CfbSLByT60I/PoHWr6gskQ==","shasum":"63874d496ed0e87d76e6c988d49e7154acb9323d","tarball":"https://registry.npmjs.org/@apriil-digital-oslo/rubics-gtm-events/-/rubics-gtm-events-1.3.0.tgz","fileCount":12,"unpackedSize":9430,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBzLfc2PY/kFMbjZ66+A3pwBYbmJldtHixVtUP44R3Y5AiEA/xn1xNiHk7MJM9/lLSmrpZgqAph7zP6MZA0pvhqgR7U="}]},"_npmUser":{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},"directories":{},"maintainers":[{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},{"name":"stianba","email":"stianba@gmail.com"},{"name":"tommyba","email":"tommy.bakkane@apriil.no"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rubics-gtm-events_1.3.0_1742204483069_0.23147674926090223"},"_hasShrinkwrap":false}},"time":{"created":"2025-03-17T07:15:54.144Z","modified":"2025-03-17T09:41:23.450Z","1.0.0":"2025-03-17T07:15:54.446Z","1.1.0":"2025-03-17T09:15:47.614Z","1.2.0":"2025-03-17T09:22:57.196Z","1.3.0":"2025-03-17T09:41:23.246Z"},"bugs":{"url":"https://github.com/ludens-reklamebyra/rubics-gtm-events/issues"},"license":"ISC","homepage":"https://github.com/ludens-reklamebyra/rubics-gtm-events#readme","repository":{"type":"git","url":"git+https://github.com/ludens-reklamebyra/rubics-gtm-events.git"},"description":"A tracking utility for Google Tag Manager","maintainers":[{"name":"oyvindhermansen","email":"oyvindher@gmail.com"},{"name":"stianba","email":"stianba@gmail.com"},{"name":"tommyba","email":"tommy.bakkane@apriil.no"}],"readme":"# rubics-gtm-events\n\nA utility function for Rubics themes regarding tracking in Google Tag Manager.\n\n## Install\n\n```sh\n$ git clone https://github.com/ludens-reklamebyra/rubics-gtm-events.git\n$ npm install\n```\n\n## Build\n\n```sh\n$ npm build\n```\n\n## Test\n\nIn watch mode:\n\n```sh\n$ npm run test:dev\n```\n\nSingle run\n\n```sh\n$ npm run test\n```\n\n## Usage\n\nImport and initialize.\n\n```ts\nimport { googleEvents } from \"@apriil-digital-oslo/rubics-gtm-events\";\n\n// Initialize your data layer.\nconst dataLayer = window.dataLayer || [];\n\n// Initialize the tracker.\nexport const tracker = googleEvents(dataLayer);\n```\n\nDo a push to the data layer for GTM to read:\n\n```ts\nimport { tracker } from \"./my-relative-path-to-tracker-init\";\n\ntracker.track(\"myEventName\", {\n  randomKey1: \"this is random data on the event\",\n  randomKey2: \"More random data\",\n  // ...more of your own data\n});\n```\n\nNeed to add ecommerce data? We support it!\nAnd the best thing? It's strictly typed based on the event you choose.\n\n> NB: The event name for ecommerce tracking is predefined by the documentation of Google.\n\n```ts\nimport { tracker } from \"./my-relative-path-to-tracker-init\";\n\ntracker.trackEcommerce(\"add_to_cart\", {\n  currency: \"NOK\",\n  value: 1000,\n  items: [\n    {\n      item_id: \"SKU_12345\",\n      item_name: \"Stan and Friends Tee\",\n      affiliation: \"Google Merchandise Store\",\n      coupon: \"SUMMER_FUN\",\n      discount: 2.22,\n      index: 0,\n      item_brand: \"Google\",\n      item_category: \"Apparel\",\n      item_category2: \"Adult\",\n      item_category3: \"Shirts\",\n      item_category4: \"Crew\",\n      item_category5: \"Short sleeve\",\n      item_list_id: \"related_products\",\n      item_list_name: \"Related Products\",\n      item_variant: \"green\",\n      location_id: \"ChIJIQBpAG2ahYAR_6128GcTUEo\",\n      price: 10.01,\n      quantity: 3,\n    },\n  ],\n});\n```\n\n### What ecommerce events do we support?\n\n- view_item_list\n- select_item\n- view_item\n- add_to_cart\n- add_to_wishlist\n- view_cart\n- remove_from_cart\n- begin_checkout\n- add_shipping_info\n- add_payment_info\n- purchase\n- refund\n- view_promotion\n- select_promotion\n\n### Want to join development?\n\n1. Create a branch prefixed with either `feature/my-branch-name`, `hotfix/my-branch-name` or `update/my-branch-name` depending on your changes.\n2. Create a pull request\n3. We try to have 100% test coverage, so that will be important not to break in future PRs.\n4. Await 🍖\n","readmeFilename":"README.md"}