# Unable to Instrument JavaScript with automatic tag injection

**URL:** <https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230>\
**Category:** Real User Monitoring\
**Tags:** real-user-monitoring-classic, iis, javascript\
**Created:** [July 3, 2019, 6:48am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230 "2019-07-03T06:48:26Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 3, 2019, 6:48am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/1 "2019-07-03T06:48:26Z")

</div>

Dear All,

Unable to instrument one of the Public Website through automatic tag injection. I found the below message in the developer’s mode.

**The key “” is not recognized and ignored.**

**[Deprecation] Setting cookies via `\<meta http-equiv=‘Set-Cookie’ …\>` no longer works, as of M65. Consider switching to `document.cookie = …`, or to `Set-Cookie` HTTP headers instead. See [Chrome Platform Status](https://www.chromestatus.com/feature/6170540112871424) for more details.**

**Blocked setting the `domain=XXXXXXXXXX.com.com; path=/;**  **httponly**** ;` cookie from a `\<meta\>` tag.**

In the documentation, I found the following information.

**RUM correlation requires that the `dtCookie` and `dtPC` cookies be on web requests in order to link them to user actions. However, because `dtCookie` is part of the beacon and because the JavaScript library sets and modifies these cookies, these cookies don’t support the `HTTPOnly` flag. See [cookies](https://www.dynatrace.com/support/help/how-to-use-dynatrace/data-privacy-and-security/data-privacy/cookies/) for complete details.**

Is there any relevance between the error and the above information?

What is the solution in case they are relevant?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 3, 2019, 7:05am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/2 "2019-07-03T07:05:43Z")

</div>

Does your application work on HTTPS or HTTP? It seems that there is problem with unsecure applications.

Sebastian

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 3, 2019, 7:19am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/3 "2019-07-03T07:19:09Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html)

It is HTTPS and I checked with the _ **use the secure cookie attribute for cookie** _ and without it.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 3, 2019, 7:48am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/4 "2019-07-03T07:48:52Z")

</div>

Ok and without rum injected there is no issue, yes? I’ve never seend setting cookies via metatag in dynatrace. This is something that is strange for me.

Sebastian

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 3, 2019, 9:30am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/5 "2019-07-03T09:30:52Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html)

I am getting the below message on all the pages/tabs even though web requests are available but no UEM.

**\<!DOCTYPE html\>**

**\<html\>**

**\<head id=“Head1”\>\<meta name=“Generator” content=“Generated by rb.indi @ 03-07-2019 12:24:18” /\>\<meta charset=“utf-8” /\>\<meta name=“viewport” content="width=device-width, initial-scale=1.0 " /\>\<meta http-equiv=“set-cookie” content=“[domain=XXXXX.com.com](http://domain=XXXXX.com.com); path=/; httponly;” /\>\<title\>**

**Security - Online Banking Safety Features**

\</title\>

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 3, 2019, 9:57am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/6 "2019-07-03T09:57:34Z")

</div>

This part:

"**\<meta http-equiv=“set-cookie” content=“[domain=XXXXX.com.com](http://domain=XXXXX.com.com); path=/; httponly;” /\>"**

is not related to RUM, but this may be issue. I think that, script is doing something with cookies and in such case has problem? This may be case for support.

Sebastian

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 3, 2019, 10:42am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/7 "2019-07-03T10:42:34Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html)

Thank you for all your time to look into the said situation and opinion about the support case.

I already raised a flag with the network and security team and also going to engage the support.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 9, 2019, 8:58am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/8 "2019-07-09T08:58:45Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html)

We did manual instrumentation and able to load the JavaScript in each page of the website but even though there is no UEM data.

The result of [https://XXXXXXXX.com/system/js/rb\_5e8dab8f?type=check](https://uatrb.qcdib.com/system/js/rb_5e8dab8f?type=check) is _ **HTTP Error 404.0 - Not Found** _.

 ![21254-req-url.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/3/399fe33de402494f7d23cae0ab1c3282254a67d2.jpeg)

Any hint in this situation?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 9, 2019, 4:25pm UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/9 "2019-07-09T16:25:29Z")

</div>

Why are you asking rum Beakon url with aspx suffix?

---

<div class="post-metadata">

**Author:** ![Dant3](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dant3/32/159_2.png) [@Dant3](https://community.dynatrace.com/u/Dant3)\
**Post date:** [July 10, 2019, 4:05am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/10 "2019-07-10T04:05:26Z")

</div>

You should edit the url hotlink or remove it, since is redirecting to the real uat page. Also, as [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html) said the manual injection is kinda weird. It should end with a .js for the extension of the file. And the rb\_5e8dab8f of the callback beacon shouldnt be there.

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 10, 2019, 5:49am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/11 "2019-07-10T05:49:20Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html) and [@Dante P.](https://answers.dynatrace.com/users/27047/view.html)

Thank you both of you for your responses.

As you can see the manual injected script is loading without any issue.

 ![21274-script-loading.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/4/b477e5d3094e6b89758f1b4cdeb42cc30a835e54.png)

But when I test that the monitor signal passes through my infrastructure (_as we are not receiving any UEM data_) with the following method then I am getting _ **HTTP Error 404.0 - Not Found** _ and also Requested URL is automatically changing to the .aspx

[https://xxxxxxxx.com/system/js/rb\_5e8dab8f?type=check](https://xxxxxxxx.com/system/js/rb_5e8dab8f?type=check)

Also, I can see the below message in the developer’s mode for each request/page.

![21275-blocked-setting.png](https://global.discourse-cdn.com/dynatrace/original/3X/9/1/910ff0fba13681f8c3284c54a9b0ea1ad6fbc3e5.png)

What should be the next step in this situation to make it work?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 10, 2019, 6:24am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/12 "2019-07-10T06:24:27Z")

</div>

As I understand, webserver below this application is instrumented by oneagent? If yes I think you chould play with beacon url configuration in application settings, because such origin on js path may be blocked by webserver.

[https://xxxxxxxx.com/system/rb\_5e8dab8f?type=check](https://xxxxxxxx.com/system/js/rb_5e8dab8f?type=check)

In general, this should be default path.

Sebastian

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 10, 2019, 6:29am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/13 "2019-07-10T06:29:54Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html)

Exactly. I am doing the same to have beacon information.

What else can be the issue?

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![Dant3](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dant3/32/159_2.png) [@Dant3](https://community.dynatrace.com/u/Dant3)\
**Post date:** [July 10, 2019, 9:46am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/14 "2019-07-10T09:46:14Z")

</div>

I had a similar problem, that when sending the callback (post) didn’t go since the app server / security will not allow post, since the app itself didn’t need it, obvisuly that was a 403 and not a 404, but to make it short, since this is a managed enviroment? do you have a cluster activegate?

What I did was change the beaconurl at the app settings, so it would not back to the app server, but to the cluster Activegate.

Obviusly there is some rule at the appserver that adds the aspx extension.

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 10, 2019, 10:09am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/15 "2019-07-10T10:09:59Z")

</div>

Hello [@Dante P.](https://answers.dynatrace.com/users/27047/view.html)

This is a Pre-Production environment, hence we have only the Environment ActiveGates in different network zones.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 10, 2019, 11:01am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/16 "2019-07-10T11:01:36Z")

</div>

[@Babar Q.](https://answers.dynatrace.com/users/5357/view.html) you are not doing the same. You’ve pasted url with /js/ in path 🙂

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 11, 2019, 6:17am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/17 "2019-07-11T06:17:16Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html)

Believe me, I removed the /js/ and even more than this during exercise. I will share the findings here.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 11, 2019, 6:35am UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/18 "2019-07-11T06:35:04Z")

</div>

For me 404 means that web server is blocking your beacon. I’ve had such scenarios. Check on what path is your webserver receiving xhr’s and try to modify beacon url to make it the same for agent.

Sebastian

---

<div class="post-metadata">

**Author:** ![Babar\_Qayyum](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/babar_qayyum/32/13620_2.png) [@Babar\_Qayyum](https://community.dynatrace.com/u/Babar_Qayyum)\
**Post date:** [July 11, 2019, 2:19pm UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/19 "2019-07-11T14:19:00Z")

</div>

Hello [@sebastian k.](https://answers.dynatrace.com/users/15061/view.html) and [@Dante P.](https://answers.dynatrace.com/users/27047/view.html)

I wanted to share the drop seen of this issue. There was a blunder from our side which is overlooked while installing the OneAgent.

The same server was instrumented by AppMon agent in the past and without uninstalling the AppMon Web Server Agent we installed the OneAgent on top of it which simply stopped the AppMon Web Agent Service but the Native Module information was still intact.

In short, after removal of AppMon and restarting the server beacon data started receiving as expected.

Regards,

Babar

---

<div class="post-metadata">

**Author:** ![skrystosik](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/skrystosik/32/21133_2.png) [@skrystosik](https://community.dynatrace.com/u/skrystosik)\
**Post date:** [July 11, 2019, 4:29pm UTC](https://community.dynatrace.com/t/unable-to-instrument-javascript-with-automatic-tag-injection/21230/20 "2019-07-11T16:29:03Z")

</div>

Cool 😉 nice to hear
