Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prestashopcorp/segment-vue

Package Overview
Dependencies
Maintainers
5
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prestashopcorp/segment-vue

plugin vue for segment

  • 2.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-33.33%
Maintainers
5
Weekly downloads
 
Created
Source

vue-segment

Vue plugin for Segment

Vue.js plugin for Segment

Segment Analytics.js Documentation

Requirements

Vue ^2.0.0

npm install @prestashopcorp/segment-vue
import Vue from 'vue'
import SegmentVue from '@prestashopcorp/segment-vue'

Vue.use(SegmentVue, {
  id: 'XXXXX',
});

Identify

add this on your App.vue file

created(){
  this.$segment.identify({shopId}, {
    name: "FullName_account",
    email: "email_account",
    plan: "premium_account"
  })
}

Track

add this on each method click

handleClick(){
  this.$segment.track(NAME_YOUR_TRACK, 
  //optional properties
  { 
    name: "it's your track name",
    category: "ps_metrics",
  })
}

Options

route track option

put the name attribute in each route and add your router to the vue-segment initialization

export default {
  path: "dashboard",
  name: "dashboard", //Set name on each route
  component: DashboardApp,
};

Vue.use(SegmentVue, {
  id: 'XXXXX',
  router
});

exclude route option

export default {
  name: "activity",
  path: "activity",
  meta: {exclude: true},  // <= add this key in your route object, true to exclude, false to track
  component: () =>
    import(
      /* webpackChunkName: "dashboardActivity" */ "@/core/dashboard/pages/ActivityApp"
    ),
  redirect: "activity/revenue",
  children: [RevenueRouter, OrderRouter, ConversionRouter, VisitRouter],
};

page category option

put the name attribute in each route and add your router to the vue-segment initialization

Vue.use(SegmentVue, {
  id: 'XXXXX',
  router,
  pageCategory: "ps_metrics_"
});

FAQs

Package last updated on 04 Jun 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc