Title: JavaScript error when Events Manager event is draft
Last modified: August 20, 2016

---

# JavaScript error when Events Manager event is draft

 *  Resolved [webaware](https://wordpress.org/support/users/webaware/)
 * (@webaware)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-when-events-manager-event-is-draft/)
 * G’day,
 * Using Events Manager, with an event created by another user and saved as a draft,
   I get a JavaScript error — analyticsFileTypes is not defined. This breaks other
   script on the page.
 * It happens because `is_preview()` is true, so the GA script block isn’t loaded,
   but external-tracking.min.js is still loaded and executes, generating the error.
 * To fix, I wrapped the code within the ready handler function in a test:
 *     ```
       // only if GA script block has been loaded
       if (typeof analyticsFileTypes != "undefined") {
       ...
       }
       ```
   
 * I’d appreciate it if you could add this to your next release.
 * cheers,
    Ross
 * [http://wordpress.org/extend/plugins/google-analyticator/](http://wordpress.org/extend/plugins/google-analyticator/)

Viewing 1 replies (of 1 total)

 *  [Video User Manuals](https://wordpress.org/support/users/videousermanuals/)
 * (@videousermanuals)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-when-events-manager-event-is-draft/#post-3559226)
 * Thanks Ross,
 * will release in 6.4.4 soon.
 * Ben

Viewing 1 replies (of 1 total)

The topic ‘JavaScript error when Events Manager event is draft’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/google-analyticator_fefefe.svg)
 * [Analyticator](https://wordpress.org/plugins/google-analyticator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-analyticator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-analyticator/)
 * [Active Topics](https://wordpress.org/support/plugin/google-analyticator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-analyticator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-analyticator/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Video User Manuals](https://wordpress.org/support/users/videousermanuals/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/javascript-error-when-events-manager-event-is-draft/#post-3559226)
 * Status: resolved