1.3 Google Analytics / JavaScript Broken

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
RedSpider
Posts: 36
Joined: 30 Jan 2015, 19:47

1.3 Google Analytics / JavaScript Broken

Post by RedSpider »

Hello, looking at this thread, It seems i now found out why Google Analytics is broken since upgrading to 1.3.

Is there a a fix for this?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: 1.3 Google Analytics / JavaScript Broken

Post by atrol »

Please use Search before posting and read the Manual
RedSpider
Posts: 36
Joined: 30 Jan 2015, 19:47

Re: 1.3 Google Analytics / JavaScript Broken

Post by RedSpider »

Hi,

Sorry i'm confused (that thread was a bit hard to follow!), is there a patch we can implement for an immediate fix on this? I have a large project going live next week and i really need to be able to measure user interaction.

Thanks
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: 1.3 Google Analytics / JavaScript Broken

Post by atrol »

RedSpider wrote:is there a patch we can implement for an immediate fix on this?
The ongoing discussion in the pull request is about a clean fix.
This means having the best security in Mantis out of the box, but to allow administrators and/or plugin authors to add rules to allow foreign trusted resources.
This discussion and the final implementation might end the next few days or might last longer if there is no common decision or there are bugs when testing.
So the answer to your questions depends on what you mean with "fix".
The clean fix, or a dirty workaround that comes with reduced security.
RedSpider wrote:and i really need to be able to measure user interaction.
Interesting.
Can you tell a bit about what you are measuring and what is your plan to to depending on the results?
Please use Search before posting and read the Manual
RedSpider
Posts: 36
Joined: 30 Jan 2015, 19:47

Re: 1.3 Google Analytics / JavaScript Broken

Post by RedSpider »

atrol wrote:So the answer to your questions depends on what you mean with "fix".
The clean fix, or a dirty workaround that comes with reduced security.
At the moment I'll settle for a dirty workaround, since my site in question is running behind CloudFlare I am afforded some protection from them and their WAF.

atrol wrote:Can you tell a bit about what you are measuring and what is your plan to to depending on the results?
I need to be able to use data from Google Analytics to gather information on users, sessions, time on the site etc so i can build a picture of how the site is being used so that i can use this as proof of concept that it delivers better quality feedback for both end users and developers.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: 1.3 Google Analytics / JavaScript Broken

Post by atrol »

There is this piece of code in file core/http_api.php

Code: Select all

function http_all_headers() {
	global $g_bypass_headers;

	if( !$g_bypass_headers && !headers_sent() ) {
		http_content_headers();
		http_caching_headers();
		http_security_headers();
		http_custom_headers();
	}
}
Just add a #, change it to

Code: Select all

function http_all_headers() {
	global $g_bypass_headers;

	if( !$g_bypass_headers && !headers_sent() ) {
		http_content_headers();
		http_caching_headers();
#		http_security_headers();
		http_custom_headers();
	}
}
Please use Search before posting and read the Manual
RedSpider
Posts: 36
Joined: 30 Jan 2015, 19:47

Re: 1.3 Google Analytics / JavaScript Broken

Post by RedSpider »

Thank you. I'll use this (cautiously) as an interim fix while the new release goes out :)
Post Reply