* Set Amplitude session ID. Ref https://bit.ly/3vElAym * @param {string} sessionId - Minimum visit length before first page ping event fires
(sessionId)
| 171 | * @param {string} sessionId - Minimum visit length before first page ping event fires |
| 172 | */ |
| 173 | function setSessionId(sessionId) { |
| 174 | if (typeof window.amplitude === 'undefined') { |
| 175 | console.log('Amplitude not loaded yet') |
| 176 | return false |
| 177 | } |
| 178 | const amplitudeInstance = window.amplitude.getInstance() |
| 179 | amplitudeInstance.setSessionId(sessionId) |
| 180 | amplitudeInstance.enableTracking() |
| 181 | } |
| 182 | |
| 183 | export default amplitudePlugin |