# Embed Live Chat Widget code in a React application

**URL:** <https://community.hubspot.com/t/embed-live-chat-widget-code-in-a-react-application/44622>\
**Category:** CMS Development\
**Created:** [September 30, 2021, 1:41pm UTC](https://community.hubspot.com/t/embed-live-chat-widget-code-in-a-react-application/44622 "2021-09-30T13:41:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![K3nsimple](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/k3nsimple/32/99782_2.png) [@K3nsimple](https://community.hubspot.com/u/K3nsimple)\
**Post date:** [September 30, 2021, 1:41pm UTC](https://community.hubspot.com/t/embed-live-chat-widget-code-in-a-react-application/44622/1 "2021-09-30T13:41:47Z")

</div>

By copying tracking code to Head Section of a React application, will this be enough for enabling Chat Widget?

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [October 1, 2021, 4:24pm UTC](https://community.hubspot.com/t/embed-live-chat-widget-code-in-a-react-application/44622/2 "2021-10-01T16:24:56Z")

</div>

@K3nsimple ,

You could put it in the head, but it is recommended to have it just before the closing body tag

@miljkovicmisa , does this sound correct?

---

<div class="post-metadata">

**Author:** ![miljkovicmisa](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/miljkovicmisa/32/86357_2.png) [@miljkovicmisa](https://community.hubspot.com/u/miljkovicmisa)\
**Post date:** [October 1, 2021, 4:59pm UTC](https://community.hubspot.com/t/embed-live-chat-widget-code-in-a-react-application/44622/3 "2021-10-01T16:59:56Z")

</div>

👋 @dennisedson, hello @K3nsimple , this is correct, it’s always better to include scripts before the closing of the body tag to avoid render blocking.  
I would also suggest [this link here](https://developers.hubspot.com/docs/cms/guides/js-frameworks#reactjs) , outlining some points when working with frameworks like react.  
If you are including scripts in your app it’s best practice to use `require_js` function, [more info on that here](https://developers.hubspot.com/docs/cms/hubl/functions#require-js).  
Cheers!

---

<div class="post-metadata">

**Author:** ![K3nsimple](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/k3nsimple/32/99782_2.png) [@K3nsimple](https://community.hubspot.com/u/K3nsimple)\
**Post date:** [October 1, 2021, 5:30pm UTC](https://community.hubspot.com/t/embed-live-chat-widget-code-in-a-react-application/44622/4 "2021-10-01T17:30:29Z")

</div>

Thanks for the great response.
