Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Analytics MIME type issue in Chrome using Rails 3
    primarykey
    data
    text
    <p>I'm adding GA to a Rails 3 app, which would normally be extremely simple, of course. I've added the GA JS snippet, which is rendering just fine. Everything works perfectly in Safari. In Chrome, however, it's giving me a console error: Resource interpreted as Script but transferred with MIME type text/html: "about:blank", pointing to the JS line that loads the ga.js file: s.parentNode.insertBefore(ga, s). Some things I've investigated:</p> <ul> <li>I created a plan HTML page with the JS snippet, and it loads outside Rails in Chrome with no error.</li> <li>The same HTML page, when put in /public, gives the error above.</li> <li>The same HTML page, loaded in Safari from /public, doesn't give any error according to Firebug.</li> <li>I tried the GA Debug extension in Chrome, but it remains silent, because ga.js isn't getting loaded.</li> </ul> <p>Looking at the developer console in Chrome, I see a request for "<a href="http://www.google-analytics.com/ga.js" rel="noreferrer">http://www.google-analytics.com/ga.js</a>" that seems to stay in "pending" state, and a redirect to "about:blank" seemingly initiated by <a href="http://www.google-analytics.com/ga.js" rel="noreferrer">http://www.google-analytics.com/ga.js</a>, which makes very little sense.</p> <p>So this seems to be related to Rails (since the snippet works in the HTML outside Rails), and doesn't affect Safari, but other than that I'm stumped. Hopefully I've just been staring at it wrong, and someone else will point out the obvious to me...? Anyone come across this before? Any ideas will be very much appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload