Document Download
"*" indicates required fields
formInteractions: true, fileDownloads: true } }); const sessionReplayTracking = window.sessionReplay.plugin({ sampleRate: 0.1 }); amplitudeInstance.add(sessionReplayTracking); // Exclude GA4-forwarded copies of AI chat events. // Keep direct Amplitude events and all other GA4 events. amplitudeInstance.add({ name: 'ak-chat-ga4-duplicate-filter', type: 'enrichment', execute: async function(event) { var isChatEvent = [ 'ak_ai_chat_click', 'ak_ai_chat_open', 'ak_ai_chat_close' ].includes(event.event_type); var isGA4Forwarded = event.event_properties && event.event_properties['Measurement ID'] === 'G-K16LPLHH1S'; if (isChatEvent && isGA4Forwarded) { return null; } return event; } }); // Preserve GA4 forwarding for all other events if (window.gaEventsForwarder && window.gaEventsForwarder.plugin) { amplitudeInstance.add(window.gaEventsForwarder.plugin()); console.log('GA Events Forwarder added'); } console.log('Amplitude + Session Replay initialized correctly'); })();
"*" indicates required fields