Skip to content

Commit

Permalink
refactor: added segment constant for component generator
Browse files Browse the repository at this point in the history
  • Loading branch information
PKulkoRaccoonGang committed Dec 17, 2023
1 parent 12ef94b commit e809a3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion www/netlify/functions/trackGenerateComponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { v4: uuidv4 } = require('uuid');
const Analytics = require('analytics-node');
const { COMPONENT_GENERATED_EVENT } = require('../../segment-events');

const analytics = new Analytics(process.env.SEGMENT_KEY);

Expand All @@ -12,7 +13,7 @@ exports.handler = async function eventHandler(event) {
// dispatch event to Segment
analytics.track({
anonymousId: uuidv4(),
event: 'openedx.paragon.functions.track-generate-component.created',
event: COMPONENT_GENERATED_EVENT,
properties: { componentName },
});

Expand Down
1 change: 1 addition & 0 deletions www/segment-events/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const ICON_COPIED_EVENT = 'openedx.paragon.docs.icons-table.selected-icon
export const LEAVE_FEEDBACK_CLICKED_EVENT = 'openedx.paragon.docs.leave-feedback.clicked';
export const CONTRAST_CHECKER_CLICKED_EVENT = 'openedx.paragon.docs.menu.tools.visit-contrast-checker.clicked';
export const PAGE_EDIT_BTN_CLICKED_EVENT = 'openedx.paragon.docs.page-edit.clicked';
export const COMPONENT_GENERATED_EVENT = 'openedx.paragon.functions.track-generate-component.created';

export const PLAYGROUND_EVENTS = {
LINK_CLICKED: 'openedx.paragon.docs.menu.playground.visit-playground.clicked',
Expand Down

0 comments on commit e809a3a

Please sign in to comment.