Title: ec.js support
Last modified: September 30, 2019

---

# ec.js support

 *  Resolved [titsmaker](https://wordpress.org/support/users/titsmaker/)
 * (@titsmaker)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/ec-js-support/)
 * I am not sure if this falls under “I have another file I want to host locally.
   Could you make a plugin?” category, but when you enable enchanced ecommerce tracking
   another js file (ec.js) is added to analytics.js and it is being loaded from 
   Google.

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

 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/ec-js-support/#post-11982770)
 * Hi [@titsmaker](https://wordpress.org/support/users/titsmaker/),
 * Have you tried enabling Stealth Mode and updating analytics.js again? This’ll
   trigger ec.js to also be locally hosted. 😀
 *  Thread Starter [titsmaker](https://wordpress.org/support/users/titsmaker/)
 * (@titsmaker)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/ec-js-support/#post-12004975)
 * Thanks, that worked. But now I am getting 2 requests for ec.js, first of them
   with 302 status and second successfull. First request adds rather significant
   time to page loading time.
 *  Plugin Author [Daan van den Bergh](https://wordpress.org/support/users/daanvandenbergh/)
 * (@daanvandenbergh)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/ec-js-support/#post-12005038)
 * Yes, I’m afraid there’s no other way around this. Here’s how it works:
 * The analytics.js contains the requests to ec.js. Stealth mode rewrites these 
   requests to a local endpoint. But this endpoint is the same for all Google Analytics-
   related requests — this is due to the structure of analytics.js, i.e. something
   I can’t influence.
 * This endpoint captures the request to ec.js and redirects it to the locally hosted
   file.
 *  Thread Starter [titsmaker](https://wordpress.org/support/users/titsmaker/)
 * (@titsmaker)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/ec-js-support/#post-12006044)
 * Thank you for clarification!

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

The topic ‘ec.js support’ is closed to new replies.

 * ![](https://ps.w.org/host-analyticsjs-local/assets/icon-256x256.png?rev=3307068)
 * [CAOS | Host Google Analytics Locally](https://wordpress.org/plugins/host-analyticsjs-local/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/host-analyticsjs-local/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/host-analyticsjs-local/)
 * [Active Topics](https://wordpress.org/support/plugin/host-analyticsjs-local/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/host-analyticsjs-local/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/host-analyticsjs-local/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [titsmaker](https://wordpress.org/support/users/titsmaker/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/ec-js-support/#post-12006044)
 * Status: resolved