Skip to content

Commit 649c09c

Browse files
authored
Merge pull request #7505 from segmentio/DOC-1066
Updated Documentation for trackLink [DOC-1066]
2 parents 94aecae + 2cbc000 commit 649c09c

File tree

1 file changed

+4
-3
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+4
-3
lines changed

src/connections/sources/catalog/libraries/website/javascript/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ The only required argument on Track calls in Analytics.js is an `event` name str
138138

139139
#### Track link
140140

141-
`trackLink` is a helper method that attaches the `track` call as a handler to a link.
142-
With `trackLink`, Analytics.js inserts a timeout of 300 ms to give the `track` call more time. This is useful when a page would redirect before the `track` method could complete all requests.
141+
`trackLink` is a helper method that attaches a Track call as a handler to a link. When a user clicks the link, `trackLink` delays the navigation event by 300ms before proceeding, ensuring the Track request has enough time to send before the page starts unloading.
143142

144-
The `trackLink` method follows the format below.
143+
This is useful when a page redirects too quickly, preventing the Track method from completing all requests. By momentarily holding off navigation, `trackLink` increases the likelihood that tracking data reaches Segment and destinations successfully.
144+
145+
The `trackLink` method follows the format below:
145146

146147
```js
147148
analytics.trackLink(element, event, [properties])

0 commit comments

Comments
 (0)