Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@vivareal/gtm-tracker
Advanced tools
@vivareal/gtm-tracker
Tracker to populate the GTM dataLayer and add clickstream global method
// ../gtm-tracker.js
import { GTMTracker } from '@vivareal/gtm-tracker';
export default new GTMTracker({
id: 'GTM-XXXXX',
dataLayerName: 'dataLayerClickstream',
trackerEndpoint: '', // clickstream URL
enabled: true,
debug: false,
});
Option | default | Desc |
---|---|---|
id | null | GTM Id |
dataLayerName | dataLayerClickstream | same name as you used when importing the GTM plugin |
trackerEndpoint | '' | Your tracking server endpoint |
enabled | true | Start enabled/disabled |
debug | false | Debug enabled |
import Vue from 'vue';
import { VueGtm } from '@vivareal/gtm-tracker';
import tracker from './gtm-tracker';
Vue.use(VueGtm, { tracker });
This will enable in your project to use the tracker directly in components in a "Vue-way"
// App.js
export default {
watch: {
// If using vue-router
$route(to) {
this.$gtm.pageView(to);
},
},
};
Please note that you don't need to add it as a plugin, you can simply import the tracker directly in components, and use it, but this removes the need to import it in every component that you want to track something
Method | Desc |
---|---|
trackEvent(Obj) | Object to populate dataLayer, it demands a event key |
pageView(Obj) | Will populate dataLayer with an object containing { event: 'pageRendered' } |
pushDataLayer(Obj) | Directly input any object into the dataLayer |
enable(Boolean) | Enable or disable tracking |
debug(Boolean) | Enable or disable debugging |
dataLayer() | Retrieves current dataLayer array |
FAQs
GTM Tracker with clickstream helper
The npm package @vivareal/gtm-tracker receives a total of 101 weekly downloads. As such, @vivareal/gtm-tracker popularity was classified as not popular.
We found that @vivareal/gtm-tracker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 118 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.