Title: bug: double javascript
Last modified: January 3, 2024

---

# bug: double javascript

 *  Resolved [julinformatique](https://wordpress.org/support/users/julinformatique/)
 * (@julinformatique)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/bug-double-javascript/)
 * In the instructions you say to add the following javascript before </head> :
 * However the plugin via the Sender_Automated_Emails.php file automatically writes
   the script
 *     ```wp-block-code
           echo "
               <script>
                 (function (s, e, n, d, er) {
                   s['Sender'] = er;
                   s[er] = s[er] || function () {
                     (s[er].q = s[er].q || []).push(arguments)
                   }, s[er].l = 1 * new Date();
                   var a = e.createElement(n),
                       m = e.getElementsByTagName(n)[0];
                   a.async = 1;
                   a.src = d;
                   m.parentNode.insertBefore(a, m)
                 })(window, document, 'script', 'https://cdn.sender.net/accounts_resources/universal.js', 'sender');
                 sender('{$key}');
               </script>
               ";
       ```
   
 * So this is a duplicate of the instructions. Furthermore, displaying the div with
   the script already injected into the </head> tag does not work. We therefore 
   recommend removing the echo in Sender_Automated_Emails.php and adding the javascript
   directly to a widget

Viewing 1 replies (of 1 total)

 *  Plugin Author [Sender.net](https://wordpress.org/support/users/sendernet/)
 * (@sendernet)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/bug-double-javascript/#post-17390863)
 * Hi julinformatique,
 * Yes indeed there is no need to implement again the script when you are using 
   the plugin. We have just recently updated how the form is been displayed in page
   block, page builders and widget.
 * Let us know if work properly for your case.
 * Regards.

Viewing 1 replies (of 1 total)

The topic ‘bug: double javascript’ is closed to new replies.

 * ![](https://ps.w.org/sender-net-automated-emails/assets/icon-256×256.png?rev=
   2797779)
 * [Sender - Newsletter, SMS and Email Marketing Automation for WooCommerce](https://wordpress.org/plugins/sender-net-automated-emails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sender-net-automated-emails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sender-net-automated-emails/)
 * [Active Topics](https://wordpress.org/support/plugin/sender-net-automated-emails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sender-net-automated-emails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sender-net-automated-emails/reviews/)

## Tags

 * [form](https://wordpress.org/support/topic-tag/form/)
 * [script](https://wordpress.org/support/topic-tag/script/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 1 reply
 * 2 participants
 * Last reply from: [Sender.net](https://wordpress.org/support/users/sendernet/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/bug-double-javascript/#post-17390863)
 * Status: resolved