@@ -49,8 +49,8 @@
|
||||
</style>
|
||||
<title><%= app.title %></title>
|
||||
|
||||
<% if (app.googleAnalyticsTrackingId && typeof app.googleAnalyticsTrackingId
|
||||
=== 'string') { %>
|
||||
<% if (app.googleAnalyticsTrackingId && typeof
|
||||
app.googleAnalyticsTrackingId==='string' ) { %>
|
||||
<script
|
||||
async
|
||||
src="https://www.googletagmanager.com/gtag/js?id=<%= app.googleAnalyticsTrackingId %>"
|
||||
@@ -64,8 +64,43 @@
|
||||
|
||||
gtag('config', '<%= app.googleAnalyticsTrackingId %>');
|
||||
</script>
|
||||
<% } %> <% if (app.datadogRum.clientToken && app.datadogRum.applicationId )
|
||||
{ %>
|
||||
<script>
|
||||
(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.js',
|
||||
'DD_RUM',
|
||||
);
|
||||
DD_RUM.onReady(function () {
|
||||
DD_RUM.init({
|
||||
clientToken: '<%= app.datadogRum.clientToken %>',
|
||||
applicationId: '<%= app.datadogRum.applicationId %>',
|
||||
site: '<%= app.datadogRum.site %>' || 'datadoghq.com',
|
||||
service: 'backstage',
|
||||
env: '<%= app.datadogRum.env %>',
|
||||
sampleRate: 100,
|
||||
trackInteractions: true,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% } %>
|
||||
</head>
|
||||
|
||||
<body style="margin: 0">
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -180,6 +180,36 @@
|
||||
"UA-000000-0"
|
||||
]
|
||||
},
|
||||
"datadogRum": {
|
||||
"type": "object",
|
||||
"description": "Datadog RUM events configuration",
|
||||
"properties": {
|
||||
"env": {
|
||||
"type": "string",
|
||||
"visibility": "frontend",
|
||||
"description": "Environment for Datadog RUM events"
|
||||
},
|
||||
"clientToken": {
|
||||
"type": "string",
|
||||
"visibility": "frontend",
|
||||
"description": "clientToken for Datadog RUM events"
|
||||
},
|
||||
"applicationId": {
|
||||
"type": "string",
|
||||
"visibility": "frontend",
|
||||
"description": "applicationId for Datadog RUM events"
|
||||
},
|
||||
"site": {
|
||||
"type": "string",
|
||||
"visibility": "frontend",
|
||||
"description": "site for Datadog RUM events"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"clientToken",
|
||||
"applicationId"
|
||||
]
|
||||
},
|
||||
"listen": {
|
||||
"type": "object",
|
||||
"description": "Listening configuration for local development",
|
||||
|
||||
@@ -127,6 +127,16 @@ export async function createConfig(
|
||||
googleAnalyticsTrackingId: frontendConfig.getOptionalString(
|
||||
'app.googleAnalyticsTrackingId',
|
||||
),
|
||||
datadogRum: {
|
||||
env: frontendConfig.getOptionalString('app.datadogRum.env'),
|
||||
clientToken: frontendConfig.getOptionalString(
|
||||
'app.datadogRum.clientToken',
|
||||
),
|
||||
applicationId: frontendConfig.getOptionalString(
|
||||
'app.datadogRum.applicationId',
|
||||
),
|
||||
site: frontendConfig.getOptionalString('app.datadogRum.site'),
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user