Support » Plugin: CAOS | Host Google Analytics Locally » ec.js support

  • Resolved titsmaker


    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


    Hi @titsmaker,

    Have you tried enabling Stealth Mode and updating analytics.js again? This’ll trigger ec.js to also be locally hosted. 😀

    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


    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.

    Thank you for clarification!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.