Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Segment analytics plugin #1400

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 88 additions & 0 deletions content/backstage/plugins/twilio-segment-analytics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
humanName: Twilio Segment
heading: 'Backstage Twilio Segment Analytics Plugin'
lead: 'An opinionated implementation of the Backstage Analytics API for Segment, from the folks at Segment.'
attribution:
text: Twilio Segment
href: https://segment.com

seo:
title: 'Backstage Twilio Segment Analytics Plugin | Roadie'
description: |
An opinionated implementation of the Backstage Analytics API for Segment, from the folks at Segment.

logoImage: '../../assets/logos/twilio-segment/twilio-segment.png'

gettingStarted:
- intro: Install the plugin
language: bash
code: yarn --cwd packages/app add @segment backstage-plugin-analytics-module-segment

- intro: Import it into your Backstage application
language: typescript
code: |
// packages/app/src/apis.ts
import {
analyticsApiRef,
configApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { SegmentAnalytics } from '@segment/backstage-plugin-analytics-module-segment';

export const apis: AnyApiFactory[] = [
// Instantiate and register the SegmentAnalytics API Implementation.
createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
SegmentAnalytics.fromConfig(configApi, {
identityApi,
}),
}),
];

- intro: Optionally configure user anonymization (by default, this analytics plugin identifies the user taking actions as the logged in Backstage User's entity reference string)
language: typescript
code: |
// packages/app/src/apis.ts
import {
analyticsApiRef,
configApiRef,
identityApiRef,
} from '@backstage/core-plugin-api';
import { SegmentAnalytics } from '@segment/backstage-plugin-analytics-module-segment';

export const apis: AnyApiFactory[] = [
// Instantiate and register the SegmentAnalytics API Implementation.
createApiFactory({
api: analyticsApiRef,
deps: { configApi: configApiRef, identityApi: identityApiRef },
factory: ({ configApi, identityApi }) =>
SegmentAnalytics.fromConfig(configApi, {
identityApi,
userIdTransform: 'sha-256',
}),
}),
];

- intro: Configure the plugin
language: yaml
code: |
// app-config.yaml
app:
analytics:
segment:
writeKey: abcABCfooBARtestKEY
---

### Things to know

- This plugin requires an active workspace with [Segment](https://segment.com/).
- This plugin uses [Analytics.js Source](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/).
- You'll need a [Segment Write Key](https://segment.com/docs/connections/find-writekey/) to use this plugin.
-

### Useful links

- [npm]()
- [GitHub](https://github.com/segmentio/segment-backstage-plugins/tree/main/plugins/analytics-module-segment)
Loading