Title: Executing Javascript on message load
Last modified: September 12, 2019

---

# Executing Javascript on message load

 *  Resolved [nicoter](https://wordpress.org/support/users/nicoter/)
 * (@nicoter)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/executing-javascript-on-message-load/)
 * Hi,
 * I’d like to track goals and events in my analytics software based on the conversation
   flow.
 * I tried adding this into the text response:
 * `<script> _paq.push(['trackGoal', 2]); </script>`
 * I can see it in the source code, but it doesn’t record a goal.
    But when I add
   a button to the text response and click it, the goal gets recorded:
 * `<button onclick="javascript:_paq.push(['trackGoal', 2]);">Test</button>`
 * How can make the JS function execute on message load?
 * Thanks

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * (@intelahelp)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/executing-javascript-on-message-load/#post-11928043)
 * Hello [@nicoter](https://wordpress.org/support/users/nicoter/).
    Thank you for
   contacting us. We are looking into it.
 *  Plugin Author [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * (@intelahelp)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/executing-javascript-on-message-load/#post-11967791)
 * Hello [@nicoter](https://wordpress.org/support/users/nicoter/).
 * Unfortunately, the functionality for launching JavaScript response from Watson
   Assistant is not implemented.
    But if you want to take part in this implementation,
   you can offer a merge request at: [https://github.com/Intela-solutions/watson-assistant-wordpress](https://github.com/Intela-solutions/watson-assistant-wordpress).
   If you need to track the history of conversations, you can enable saving it in
   the plugin settings ([sample screenshot](https://pasteboard.co/Iz2f4Aa.png)).
   Then you can get the history from database using SQL queries.
 * If you have more questions, don’t hesitate to ask them.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Executing Javascript on message load’ is closed to new replies.

 * ![](https://ps.w.org/conversation-watson/assets/icon-256x256.png?rev=1684465)
 * [Chatbot with IBM watsonx Assistant](https://wordpress.org/plugins/conversation-watson/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/conversation-watson/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/conversation-watson/)
 * [Active Topics](https://wordpress.org/support/plugin/conversation-watson/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/conversation-watson/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/conversation-watson/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Intela-bot Help](https://wordpress.org/support/users/intelahelp/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/executing-javascript-on-message-load/#post-11967791)
 * Status: resolved