Skip to content

Latest commit

 

History

History
47 lines (30 loc) · 2.56 KB

STANDALONE-GTM.md

File metadata and controls

47 lines (30 loc) · 2.56 KB

AEM RUM JS - Standalone Configuration using Google Tag Manager

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:

  1. 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.
  2. 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
  3. the loading order of the RUM script may be too late to capture a significant part of user interactions
  4. 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:

Embed RUM standalone using Google Tag Manager

  1. Navigate to Google Tag Manager console

gtm-console

  1. Go to Tags
  2. Click 'New' to create a new Tag
  3. Create a 'New Tag Configuration'

gtm-new-tag

  1. Use 'Custom HTML' as the tag type

gtm-custom-html

  1. 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"/>

gtm-rum-standalone

  1. Choose a trigger to fire the tag for 'All Pages'
  2. Save and Publish the tag

Check if RUM was enabled on your site

  1. Navigate to your non AEM site
  2. Add query parameter ?rum=on to your site. Example: https://site.com?rum=on
  3. Open browser console and check that ping messages are being written

ping-messages-in-console

  1. Open the network tab of your browser and validate that ping requests using POST method to domain rum.hlx.page are being sent and that the response status is 201

rum-requests-in-network-tab