If you use Google Tag Manager to manage third party scripts, you can use it to initialize LogRocket on your application. You will need to create a tag for the LogRocket script, and select a trigger for it. We recommend using the Window Loaded trigger.
If you do not already have an app ID, visit https://app.logrocket.com to get one. Once you have an app ID, insert it into the script tag as shown below.
Add to your HTML: <script src="https://cdn.lr-in-prod.com/LogRocket.min.js"></script> <script>window.LogRocket && window.LogRocket.init('YOUR_ORG_ID/YOUR_APP_ID');</script>
Create a new Custom HTML tag in your Google Tag Manager instance and add both lines of the LogRocket script tag.
Select a trigger for the tag. We recommend Window Loaded. You can also use Page View.
Gathering more data with LogRocket in GTM
Updated 10 months ago