Download the RUM JavaScript tag for a web frontend with the Dynatrace RUM API; it references external monitoring code and suits most use cases.
| GET | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/rum/v1/manualInsertionTags/javaScriptTag/{id} |
You use the id path parameter, the Smartscape FRONTEND ID, to download the JavaScript tag for a web frontend. The tag references an external file with the monitoring code and configuration and updates dynamically, so it's recommended for most use cases. The optional scriptExecutionAttribute and crossOriginAnonymous query parameters set the async, defer, or crossorigin attributes. A 200 response returns the tag, which you add to your pages to enable Real User Monitoring.
To execute this request, you need a platform token or OAuth access token with rum:manual-insertion-tags:read scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| id | string | Smartscape FRONTEND id. | path | Required |
| scriptExecutionAttribute | string | Specifies the script execution attribute: async, defer, or none. If specified, this overrides the configured value. The element can hold these values
| query | Optional |
| crossOriginAnonymous | boolean | Indicates whether to add the crossorigin="anonymous" attribute to the tag. If specified, this overrides the configured value. | query | Optional |
| Code | Type | Description |
|---|---|---|
| 200 | string | Success. The response contains the JavaScript tag. |
| 400 | Error | Bad request. |
| 404 | Error | Frontend not found. |
| 4XX | Error | Client error. |
| 5XX | Error | Server error. |
ResponseBody objectErrorEnvelope object| Element | Type | Description |
|---|---|---|
| error | Error | - |
Error object| Element | Type | Description |
|---|---|---|
| code | integer | The HTTP status code |
| constraintViolations | Constraint | A list of constraint violations |
| message | string | The error message |
ConstraintViolation objectA list of constraint violations
| Element | Type | Description |
|---|---|---|
| location | string | - |
| message | string | - |
| parameterLocation | string | -The element can hold these values
|
| path | string | - |
{"error": {"code": 1,"constraintViolations": [{"location": "string","message": "string","parameterLocation": "HEADER","path": "string"}],"message": "string"}}