diff --git a/scripts/aem.js b/scripts/aem.js index 669a1a7734..cc7e33d1fd 100644 --- a/scripts/aem.js +++ b/scripts/aem.js @@ -18,7 +18,10 @@ function sampleRUM(checkpoint, data) { window.hlx = window.hlx || {}; sampleRUM.enhance = () => {}; if (!window.hlx.rum) { - const weight = new URLSearchParams(window.location.search).get('rum') === 'on' ? 1 : 100; + const weight = (window.SAMPLE_PAGEVIEWS_AT_RATE === 'high' && 10) + || (window.SAMPLE_PAGEVIEWS_AT_RATE === 'low' && 1000) + || (new URLSearchParams(window.location.search).get('rum') === 'on' && 1) + || 100; const id = Math.random().toString(36).slice(-4); const isSelected = Math.random() * weight < 1; // eslint-disable-next-line object-curly-newline, max-len