Mintlify
Javascript Code Snippet for Mintlify
Currently, there are 2 ways to implement the snippet on Mintlify
1. Without GTM
Create a custom .js file and place the Reo initiation snippet in it. Make sure to place the newly created file in docs folder provided in Mintlify scaffolding. This will enable Reo beacon across the entire documentation. Here is Mintlify link on same.
!function(){var e,t,n;e="XXXXXX",t=function(){Reo.init({clientID:"XXXXXX"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.async=!0,n.onload=t,document.head.appendChild(n)}();2. With GTM
If you don’t already have GTM integrated on your Mintlify app, add your tag ID to docs.json file and Mintlify will inject the Google Tag Manager script to all your pages. Here is quick guide on same
Once you have successfully implemented GTM on Mintlify, we can follow the steps in this guide to add Reo snippet to GTM
P.S: These instructions work on latest version of Mintlify. If you are on older version, that supports mint.json you might want to migrate to new version
Verify successful installation of Javascript on documentation webpages
Open a page on your documenation and right-click anywhere on the page.
In the dropdown menu, select Inspect.

In the elements tab, Use the Ctrl + F or Cmd + F and search for “reo.dev”

If the tracking code appears, verify that the code matches.
FAQs
How does JavaScript handle user privacy? Is there a potential risk of collecting personally identifiable information (PII) without proper consent?
Has the JavaScript been tested on different browsers and devices to ensure cross-platform compatibility and consistent behaviour?
Will the inclusion of this JavaScript affect the overall user experience of the documentation, for example, slow down UI interactions or cause unexpected behaviour?
Do you have a user consent mechanism in place to notify visitors of tracking activity and give them the opportunity to opt-out?
Are there any fail-safe mechanisms in place to prevent scripts from disrupting critical functionality in the event of an error?
Will the JavaScript code continue to perform optimally as the website traffic and user base increase over time?
Is your JavaScript compliant with relevant industry standards and best practices such as GDPR and CCPA for data protection and user consent?
Error Scenarios
Script initiationScript initiation has been modified to rely on code initiation only on successful callback post download from CDN. So it will only initiate if successfully downloaded. In case the download fails, the docJS won’t get enabled but this eliminates the likelihood of an error scenario of page breaking.
API failure on token deleteOn deletion of all Reo tokens, the most recent event tracking data will likely fail, but subsequent API calls will work fine.
Any inadvertent code failure on JavaScriptThis should not be an issue since the code is wrapped in a try-catch block, the console may throw errors, which won’t be visible even on the console since logger would be disabled on the script.
If you need assistance with the implementation, contact your Customer Success Manager via the Slack channel or email us at [email protected]
Last updated
Was this helpful?

