# Custom context merge in RUM JS

**URL:** <https://discuss.elastic.co/t/custom-context-merge-in-rum-js/202164>\
**Category:** APM\
**Tags:** rum\
**Created:** [October 3, 2019, 12:30pm UTC](https://discuss.elastic.co/t/custom-context-merge-in-rum-js/202164 "2019-10-03T12:30:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![igmdvc](https://avatars.discourse-cdn.com/v4/letter/i/5f9b8f/32.png) [@igmdvc](https://discuss.elastic.co/u/igmdvc)\
**Post date:** [October 3, 2019, 12:30pm UTC](https://discuss.elastic.co/t/custom-context-merge-in-rum-js/202164/1 "2019-10-03T12:30:05Z")

</div>

Hi,

According to APM node.js documentation:

"It’s possible to call this function multiple times within the scope of the same active transaction. For each call, the properties of the `context` argument are shallow merged with the context previously given."

We tried with on 4.4.4 JS library and is overriding evewrything. IS there any plan on having this consistent with the node.js and other languages versions or is there any reason why is not working like the node.js agent?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)\
**Post date:** [October 4, 2019, 8:26am UTC](https://discuss.elastic.co/t/custom-context-merge-in-rum-js/202164/2 "2019-10-04T08:26:54Z")

</div>

Hi Ignacio,

Seems like a bug to me, I have created an issue in the RUM to track this [https://github.com/elastic/apm-agent-rum-js/issues/448](https://github.com/elastic/apm-agent-rum-js/issues/448). Will fix it in our next release.

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 25, 2019, 4:27am UTC](https://discuss.elastic.co/t/custom-context-merge-in-rum-js/202164/3 "2019-10-25T04:27:02Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
