0.25.0 • Published 1 month ago

@botonic/plugin-segment v0.25.0

Weekly downloads
73
License
MIT
Repository
-
Last release
1 month ago

Botonic Plugin Segment

What Does This Plugin Do?

This plugin uses Segment to clean, collect and control customer data. It helps monitor performance, define decision-making processes and identify customers' interests.

Setup

  1. Run npm install --save @botonic/plugin-segment to install the plugin.
  2. Add it to the src/plugins.js file:

src/plugins.js

export const plugins = [
  {
    id: 'segment',
    resolve: require('@botonic/plugin-segment'),
    options: {
      writeKey: 'YOUR_WRITE_KEY',
    },
  },
]

Use

The default behavior of this plugin is to:

  • Identify the user during the first bot interaction.
  • Track track a page event to Segment from then on.

If you prefer to track your events manually, you can add the flag trackManually: true in your options. Once set, you can use them inside the method botonicInit on each Botonic component you want to track:

static async botonicInit({ input, session, params, lastRoutePath, plugins }) {

    let { segment } = plugins

    let userId = session.user.id
    let event = 'This is the name of the current event I'm tracking'
    let traits = { name: 'Peter', email: 'peter@domain.com', plan: 'premium' }

    await segment.identify({
      input,
      session,
      userId: userId,
      traits: traits
    })

    let properties = {
      name: "Some interesting data",
      value: "14.99"
    }

    await segment.track({ input, session, userId: userId, event, properties })
  }
0.25.0

1 month ago

0.25.0-beta.0

1 month ago

0.25.0-alpha.0

2 months ago

0.24.0

4 months ago

0.23.1

5 months ago

0.23.0

9 months ago

0.21.0

1 year ago

0.20.0

2 years ago

0.20.0-rc.0

2 years ago

0.19.0

3 years ago

0.18.0-rc.2

3 years ago

0.18.0

3 years ago

0.18.0-rc.0

3 years ago

0.17.0

3 years ago

0.17.0-rc.0

3 years ago

0.17.0-beta.0

3 years ago

0.17.0-beta.1

3 years ago

0.17.0-alpha.4

3 years ago

0.16.0-rc.0

3 years ago

0.16.0-alpha.3

3 years ago

0.16.0

3 years ago

0.16.0-alpha.4

3 years ago

0.16.0-alpha.1

3 years ago

0.16.0-alpha.0

3 years ago

0.15.0

4 years ago

0.15.0-rc.0

4 years ago

0.14.0-rc.0

4 years ago

0.14.0

4 years ago

0.13.0

4 years ago

0.13.0-rc.0

4 years ago

0.12.0

4 years ago

0.12.0-rc.0

4 years ago

0.11.0

4 years ago

0.11.0-alpha.0

4 years ago

0.8.0

5 years ago