Skip to content

Commit e94218a

Browse files
committed
feat: adding trackLink segment track to segment-plugin
1 parent 764fd74 commit e94218a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/analytics-plugin-segment/src/browser.js

+9
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ function segmentPlugin(pluginConfig = {}) {
138138
...payload.options,
139139
})
140140
},
141+
/* trackLink Segment event http://bit.ly/3RxZlDJ */
142+
trackLink: ({payload, config}) => {
143+
if (typeof analytics === 'undefined') return
144+
145+
analytics.trackLink(payload.element, payload.event, payload.properties, {
146+
integrations: config.integrations,
147+
...payload.options,
148+
})
149+
},
141150
/* Identify Segment user http://bit.ly/2VL45xD */
142151
identify: ({ payload, config }) => {
143152
if (typeof analytics === 'undefined') return

0 commit comments

Comments
 (0)