wp-google-analytics icon indicating copy to clipboard operation
wp-google-analytics copied to clipboard

How do you set additional methods?

Open ManxStef opened this issue 10 years ago • 0 comments

At the risk of asking a stupid question, how do you define additional basic GA methods? For instance, referring to the official Google Analytics docs, I'd like to set the Basic Method:

_setSiteSpeedSampleRate(sampleRate)

so I can track the page speed metrics for 100% of site visitors. But I can't seem to do this in the plugin's options because putting it in a custom variables box yields the following output in my site's source:

_gaq.push(['_setCustomVar', 1, '_setSiteSpeedSampleRate', '100']);

Which isn't correct, it should be:

_gaq.push(['_setSiteSpeedSampleRate', '100']);

Is it possible to add this method via a hook? If so, a bit of example code would be much appreciated!

If not, would it be possible to add this and maybe the _setSampleRate and _anonymizeIp() methods as options to the plugin, please?

Thanks!

ManxStef avatar Jan 10 '15 19:01 ManxStef