Skip to content

Commit

Permalink
feat: adding trackLink segment track to segment-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
enzoIto committed Oct 4, 2022
1 parent 764fd74 commit e94218a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/analytics-plugin-segment/src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ function segmentPlugin(pluginConfig = {}) {
...payload.options,
})
},
/* trackLink Segment event http://bit.ly/3RxZlDJ */
trackLink: ({payload, config}) => {
if (typeof analytics === 'undefined') return

analytics.trackLink(payload.element, payload.event, payload.properties, {
integrations: config.integrations,
...payload.options,
})
},
/* Identify Segment user http://bit.ly/2VL45xD */
identify: ({ payload, config }) => {
if (typeof analytics === 'undefined') return
Expand Down

0 comments on commit e94218a

Please sign in to comment.