掲示板

Google Analytics integration not working in https pages

thumbnail
7年前 に Fernando Fernandez によって更新されました。

Google Analytics integration not working in https pages

Expert 投稿: 396 参加年月日: 07/08/22 最新の投稿
Hi guys,

I'm having a problem in 6.2 CE GA6.

My site is running over https (using apache httpd to do the hppts offloading) and every time I load a page in Firefox I get this error in the browser console:

Blocked loading mixed active content "http://www.google-analytics.com/urchin.js"[Learn More]
ReferenceError: urchinTracker is not defined


This is blocking the automatic integration between Liferay and Google Analytics.

The error seems to be caused by the new policy in Firefox, to protect the user from loading active content (js, in this case) in http when the page was loaded via https.

I read a couple of article about this and the solution seems to be very simple: use "https:" instead of http or, when possible, just remove the "http:" part from the url.

Now the tricky part: how do I change the Liferay generated urchin loading url from http to https?

I tried to find this string on the sources but couldn't find it. Any ideas?

Thanks in advance

Fernando