Skip to content

Commit

Permalink
Merge pull request #9 from serzhik/patch-1
Browse files Browse the repository at this point in the history
Update RUMvision script to v4
  • Loading branch information
peterjaap authored Dec 2, 2024
2 parents 9a92c5e + 2d36a0a commit f950925
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/view/frontend/templates/script/rumvision.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ if (! $viewModel->shouldIncludeScript()) {

<script>
window.rumv = window.rumv || function() { (window.rumv.q = window.rumv.q || []).push(arguments) };
(function(rum, vi,si,on, d) {
if ( !new RegExp([d].join('|')).test( on.hostname ) ) {
return;
}
(function(rum, vi,si,on) {
var s = JSON.parse( sessionStorage.getItem('rumv') || '{"pageviews":0}' ); s.pageviews++;
if ( s.urls && s.regex && ( s.page = eval('('+s.regex+')')( s.urls, on.pathname ) ) && !s.page.type ) {
if ( s.urls && s.regex && ( s.page = eval('('+s.regex+')')( s.urls, vi.location.pathname ) ) && !s.page.type ) {
return sessionStorage.setItem('rumv', JSON.stringify( s ) );
}

vi.rumv.storage = s;
var head = si.querySelector('head'), js = si.createElement('script');
js.src = 'https://d5yoctgpv4cpx.cloudfront.net/RUM-'+rum+'/v3-'+on.hostname+'.js';
js.src = 'https://d5yoctgpv4cpx.cloudfront.net/'+rum+'/v4-'+vi.location.hostname+'.js';
head.appendChild(js);
})( '<?= $escaper->escapeJs($viewModel->getTrackingId()) ?>', window, document, location, '<?= $escaper->escapeJs($viewModel->getHostName()) ?>' );
})( '<?= $escaper->escapeJs($viewModel->getTrackingId()) ?>', window, document, '<?= $escaper->escapeJs($viewModel->getHostName()) ?>' );
</script>

0 comments on commit f950925

Please sign in to comment.