Standalone mode for RUM using Google Tag Manager. Google Tag Manager is an easy way to embed RUM on sites where access to the page templates is not possible, but it is not the prefered way to integrate if data consistency is a priority:
- Google Tag Manager is likely to be blocked by content blockers, such as Ad Blockers. With Ad Blocker market share close to 50%, this means a large portion of traffic would remain unmonitored.
- the loading of the RUM script may be erroneously guarded by consent opt-in. Opt-in rates are abysmally low, so the RUM script is unlikely to be loaded in that case
- the loading order of the RUM script may be too late to capture a significant part of user interactions
- the RUM script tracks clicks, media impressions, block impressions, and JavaScript errors. These things are wont to get missed when the RUM script is loaded too late.
With that being said, if using Google Tag Manager is still your best option, here is how to do it:
- Navigate to Google Tag Manager console
- Go to Tags
- Click 'New' to create a new Tag
- Create a 'New Tag Configuration'
- Use 'Custom HTML' as the tag type
- Use the 'RUM Standalone script' and insert below tag in 'Custom HTML'
<script defer type="text/javascript" src="https://rum.hlx.page/.rum/@adobe/helix-rum-js@^2/dist/rum-standalone.js"/>
- Choose a trigger to fire the tag for 'All Pages'
- Save and Publish the tag
- Navigate to your non AEM site
- Add query parameter
?rum=on
to your site. Example: https://site.com?rum=on - Open browser console and check that
ping
messages are being written
- Open the network tab of your browser and validate that ping requests using
POST
method to domainrum.hlx.page
are being sent and that the response status is201