Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Google Analytics Module Roadmap


Go to End


8 Posts   2778 Views

Avatar
candidasa

Community Member, 10 Posts

16 February 2011 at 12:17pm

Edited: 16/02/2011 12:18pm

Hi there,
I'm the new maintainer for the Google Analytics module. I'm a developer at SilverStripe.

The module is now hosted on GitHub at SilverStripe-Labs:
https://github.com/silverstripe-labs/silverstripe-googleanalytics

I've updated the readme file with a tentative roadmap. These are ideas I had for how to improve this module. I'd like to hear your feedback on which improvements are most important to you. Please be specific and state why you want a certain feature.

Also, if you are willing to help improve the module that would be great. Pick any of the improvements, implement it and submit your work using a "pull request" on github (please create a unit test for any new feature you submit).

If you have any other ideas for thing you'd like to see in the Google Analytics module please post them here for us to discuss. If enough people agree that a certain feature is worth having, I'll add it to the roadmap and we can get it implement.

All the best,
Julian

Avatar
Wade

Community Member, 6 Posts

28 February 2011 at 2:00pm

hi,
I just wanted to let you know that i have debugged the current trunk release to allow it to function for internet explorer. If you tell me how to send you my code, i will forward it all to you.
Thanks
Wade

Avatar
candidasa

Community Member, 10 Posts

28 February 2011 at 2:37pm

Hi Wade,
It would be great to get your fix, yes. Please either use the git "pull request" system to sent it or just send it to me directly.

Thanks for your help with improving this module,
Julian

Avatar
vancouverWill

Community Member, 121 Posts

15 March 2011 at 11:02am

Hi

I just downloaded the latest version and huge increase of performance over the last version I had from 18 months ago which basically allowed the user to login to google analytics from what appeard to be an iframe within SS admin. So congratulations on the work.

The admin setup is now done from siteconfig which makes sense except for the password field which is just a text field. I changed mine to a password field which SS makes really simple but it would be nice not to have to do that everytime I install the module. I can't see many advantages of giving open view to the password as it makes it a hassle when ever more than 1 person is using the back end of the site. Just a thought, maybe there is some reason I'm not noticing?

Thanks

Will

Avatar
candidasa

Community Member, 10 Posts

15 March 2011 at 11:30am

Hi Will,
You can still set the password in the _config.php file, if you don't want to use the siteconfig. But you a right, it is a good idea to use a passwordfield in the siteconfig. If you could send me a patch I will integrate it into the module code.

Best regards,
Julian

Avatar
vancouverWill

Community Member, 121 Posts

15 March 2011 at 11:42am

Thanks for the quick reply Julian. All I did was change GoogleConfig.php to, notice
**********************************
fields->addFieldToTab('Root.GoogleAnalytics', new PasswordField('GoogleAnalyticsPassword', 'Google Analytics Password (the password for the above account)'));
**********************************

this stops the user from seeing the password but doesn't encrypt it in the database

class GoogleConfig extends DataObjectDecorator {

	function extraStatics() {
		return array(
			'db' => array(
				'GoogleAnalyticsCode' => 'Varchar',
				'GoogleAnalyticsProfileId' => 'Varchar',
				'GoogleAnalyticsEmail' => 'Varchar',
				'GoogleAnalyticsPassword' => 'Varchar',
			),
		);
	}

	public function updateCMSFields(FieldSet $fields) {

		$fields->addFieldToTab("Root", new Tab('GoogleAnalytics'));
		$fields->addFieldToTab('Root.GoogleAnalytics', new TextField('GoogleAnalyticsCode', 'Google Analytics Code (UA-XXXXXX-X)'));
		$fields->addFieldToTab('Root.GoogleAnalytics', new TextField('GoogleAnalyticsProfileId', 'Google Analytics Profile ID (hidden in the URL parameter "id" of the "View Report" link inside Google Analytics)'));
		$fields->addFieldToTab('Root.GoogleAnalytics', new TextField('GoogleAnalyticsEmail', 'GoogleAnalyticsEmail (the email address of the Google Analytics account to use)'));
		$fields->addFieldToTab('Root.GoogleAnalytics', new PasswordField('GoogleAnalyticsPassword', 'Google Analytics Password (the password for the above account)'));
	}
z
	/**
	 *	Return various configuration values
	 *	
	 *	@param $key String:
	 *		'profile' the Google Analytics profile id or
	 *		'email' the Google Analytics account's email address or
	 *		'password' the password for the above Google Analytics account
	 *	@return String the config value
	 **/
	public static function get_google_config($key) {
		if(class_exists('SiteConfig') && Object::has_extension('SiteConfig', 'GoogleConfig')) {
			$config = SiteConfig::current_site_config();
		}
		switch($key) {
			case 'code': 		return !empty($config) && $config->GoogleAnalyticsCode 		? $config->GoogleAnalyticsCode 		: GoogleLogger::$google_analytics_code;
			case 'profile': 	return !empty($config) && $config->GoogleAnalyticsProfileId	? $config->GoogleAnalyticsProfileId	: GoogleAnalyzer::$profile_id;
			case 'email': 		return !empty($config) && $config->GoogleAnalyticsEmail 	? $config->GoogleAnalyticsEmail 	: GoogleAnalyzer::$email;
			case 'password': 	return !empty($config) && $config->GoogleAnalyticsPassword 	? $config->GoogleAnalyticsPassword 	: GoogleAnalyzer::$password;
		}
	}
	
}

Avatar
candidasa

Community Member, 10 Posts

15 March 2011 at 12:04pm

Thanks for the suggestion and code Will. I've updated the module.

Julian

Avatar
Wade

Community Member, 6 Posts

15 March 2011 at 1:39pm

I am sorry for posting in the wrong area, but I know that this particular thread is getting some action. I am trying to fix the whole "$can_be_root" problem, and i can't figure out how to check if the user in the admin area has the root currently selected. I have created a check for the variable as it runs through all the classes but my check removes the class from all the lists. Anyone have an example of how to check this?

Thanks
Wade