Skip to content

Instantly share code, notes, and snippets.

@scgoeswild
Created August 10, 2022 09:03
Show Gist options
  • Save scgoeswild/0925da5ca4fab74b97eafa8a16cb8d6c to your computer and use it in GitHub Desktop.
Save scgoeswild/0925da5ca4fab74b97eafa8a16cb8d6c to your computer and use it in GitHub Desktop.
Datadog specific domain activation
<script>
const applicableDomains = [
"your-domain.it",
"your-domain.com",
"your-domain.uk",
"your-domain.fr",
"your-domain.eu",
"your-domain.de"
];
if (applicableDomains.includes(window.location.host)) {
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum-v4.js','DD_RUM')
DD_RUM.onReady(function() {
DD_RUM.init({
clientToken: 'pub00000000000000000000000000',
applicationId: '2dsfdse-548we-rtxsaa-ee998744',
site: 'datadoghq.eu',
service: 'magento',
env: 'prod',
version: '1.0.0',
sampleRate: 100,
premiumSampleRate: 100,
trackInteractions: true,
defaultPrivacyLevel: 'mask-user-input',
});
DD_RUM.startSessionReplayRecording();
})
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment