1async function _aampliAmplitudeSdkInitializer() { 2 const amplitudeContextPlugin = { 3 execute: async (e) => { 4 e.library = "amplitude-ts-wordpress/0.2.3"; 5 return e; 6 }, 7 }; 8 9 if (aampliPlgScrPayload.shouldChangeLibrary === "1") { 10 window.amplitude.add(amplitudeContextPlugin); 11 } 12 13 const amplitudeConfigOptions = { 14 autocapture: { elementInteractions: true }, 15 logLevel: window.amplitude.Types.LogLevel.None, 16 ...(aampliPlgScrPayload.isEuServerZone === "1" && { serverZone: "EU" }), 17 }; 18 19 if (aampliPlgScrPayload.sessionReplay === "1") { 20 const aampliPlgRawSampleRate = parseFloat( 21 aampliPlgScrPayload?.sampleRate ?? 0 22 ); 23 const aampliPlgProcessedSampleRate = !isNaN(aampliPlgRawSampleRate) 24 ? aampliPlgRawSampleRate / 100.0 25 : 0.0; 26 const aampliPlgSdkSampleRate = 27 aampliPlgProcessedSampleRate >= 0.0 && aampliPlgProcessedSampleRate <= 1.0 28 ? aampliPlgProcessedSampleRate 29 : 0.0; 30 31 await window.amplitude.add( 32 window.sessionReplay.plugin({ sampleRate: aampliPlgSdkSampleRate }) 33 ).promise; 34 } 35 window.amplitude.init(aampliPlgScrPayload.apiKey, amplitudeConfigOptions); 36} 37 38_aampliAmplitudeSdkInitializer();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.