[Gmod-ajax] Google Analytics Advice

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Gmod-ajax] Google Analytics Advice

Richard Hayes
Hello,

What is the current state of the art for adding additional Google Analytics user accounts to JBrowse traffic reporting? We're hoping to enable page view tracking while leaving the JBrowse.org account intact.

There is discussion in https://github.com/GMOD/jbrowse/issues/589 from 2015 but that seems possibly out of date.

I tried:
1) a patch to Browser.js that adds to _reportGoogleUsageStats():
    if (this.config.self_google_analytics_account) {
        _gaq.push(['b._setAccount', this.config.self_google_analytics_account]);
        _gaq.push(['b._trackPageview']);
    }

2) Switching to analytics.js from now legacy ga.js.

3) As Vivek also suggested in 2015 (https://github.com/Arabidopsis-Information-Portal/jbrowse/blob/stable/index.html#L109-L130), I last tried setting suppressUsageStatistics to true and adding my own analytics call, both at the end of the main JBrowse function as above, or in it's own <script> to the end of <head> in index.html. Admittedly, this should also have worked, but does not. I've verified that the UA ID is correct though (we track other areas of our site with the same simple <script> statement).

I don't see jbrowse/index.html traffic in the Google real time content pane for any of these variations.

Any suggestions? Loading ga.js twice supposedly kills all reporting, so I'm next looking to see if that is inadvertantly happening.

I will build a pull request around a working solution with a new optional self_google_analytics_account global parameter.

Best regards,

Richard D. Hayes, Ph.D.
Joint Genome Institute / Lawrence Berkeley National Lab
http://phytozome.jgi.doe.gov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Analytics Advice

Eric Yao
Thanks for looking into this.  I came across this, which is an extension of Vivek's code.  Would something like this work?
https://www.optimizesmart.com/using-multiple-trackers-for-cross-domain-tracking-in-universal-analytics/



On Thu, Jul 27, 2017 at 8:56 AM, Richard Hayes <[hidden email]> wrote:
Hello,

What is the current state of the art for adding additional Google Analytics user accounts to JBrowse traffic reporting? We're hoping to enable page view tracking while leaving the JBrowse.org account intact.

There is discussion in https://github.com/GMOD/jbrowse/issues/589 from 2015 but that seems possibly out of date.

I tried:
1) a patch to Browser.js that adds to _reportGoogleUsageStats():
    if (this.config.self_google_analytics_account) {
        _gaq.push(['b._setAccount', this.config.self_google_analytics_account]);
        _gaq.push(['b._trackPageview']);
    }

2) Switching to analytics.js from now legacy ga.js.

3) As Vivek also suggested in 2015 (https://github.com/Arabidopsis-Information-Portal/jbrowse/blob/stable/index.html#L109-L130), I last tried setting suppressUsageStatistics to true and adding my own analytics call, both at the end of the main JBrowse function as above, or in it's own <script> to the end of <head> in index.html. Admittedly, this should also have worked, but does not. I've verified that the UA ID is correct though (we track other areas of our site with the same simple <script> statement).

I don't see jbrowse/index.html traffic in the Google real time content pane for any of these variations.

Any suggestions? Loading ga.js twice supposedly kills all reporting, so I'm next looking to see if that is inadvertantly happening.

I will build a pull request around a working solution with a new optional self_google_analytics_account global parameter.

Best regards,

Richard D. Hayes, Ph.D.
Joint Genome Institute / Lawrence Berkeley National Lab
http://phytozome.jgi.doe.gov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Analytics Advice

nathandunn

For Apollo we treated the analytics ID as an array and so could loop through as many analytics accounts as necessary (by default being just our internal Apollo one). 

For all of the plugin authors and the JBrowse out there, please don’t remove the JBrowse tracking! 

Nathan

On Aug 1, 2017, at 6:24 PM, Eric Yao <[hidden email]> wrote:

Thanks for looking into this.  I came across this, which is an extension of Vivek's code.  Would something like this work?
https://www.optimizesmart.com/using-multiple-trackers-for-cross-domain-tracking-in-universal-analytics/



On Thu, Jul 27, 2017 at 8:56 AM, Richard Hayes <[hidden email]> wrote:
Hello,

What is the current state of the art for adding additional Google Analytics user accounts to JBrowse traffic reporting? We're hoping to enable page view tracking while leaving the JBrowse.org account intact.

There is discussion in https://github.com/GMOD/jbrowse/issues/589 from 2015 but that seems possibly out of date.

I tried:
1) a patch to Browser.js that adds to _reportGoogleUsageStats():
    if (this.config.self_google_analytics_account) {
        _gaq.push(['b._setAccount', this.config.self_google_analytics_account]);
        _gaq.push(['b._trackPageview']);
    }

2) Switching to analytics.js from now legacy ga.js.

3) As Vivek also suggested in 2015 (https://github.com/Arabidopsis-Information-Portal/jbrowse/blob/stable/index.html#L109-L130), I last tried setting suppressUsageStatistics to true and adding my own analytics call, both at the end of the main JBrowse function as above, or in it's own <script> to the end of <head> in index.html. Admittedly, this should also have worked, but does not. I've verified that the UA ID is correct though (we track other areas of our site with the same simple <script> statement).

I don't see jbrowse/index.html traffic in the Google real time content pane for any of these variations.

Any suggestions? Loading ga.js twice supposedly kills all reporting, so I'm next looking to see if that is inadvertantly happening.

I will build a pull request around a working solution with a new optional self_google_analytics_account global parameter.

Best regards,

Richard D. Hayes, Ph.D.
Joint Genome Institute / Lawrence Berkeley National Lab
http://phytozome.jgi.doe.gov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Analytics Advice

Richard Hayes
Is that apollo code change something easily retrofitted to non-apollo jbrowse?

I was going to try a joint account setup again with analytics.js, but not all of the current stock jbrowse metrics are necessarily easily ported over from ga.js analytics, I think. Happy to be wrong there.

On Aug 1, 2017 9:34 PM, "Nathan Dunn" <[hidden email]> wrote:

For Apollo we treated the analytics ID as an array and so could loop through as many analytics accounts as necessary (by default being just our internal Apollo one). 

For all of the plugin authors and the JBrowse out there, please don’t remove the JBrowse tracking! 

Nathan

On Aug 1, 2017, at 6:24 PM, Eric Yao <[hidden email]> wrote:

Thanks for looking into this.  I came across this, which is an extension of Vivek's code.  Would something like this work?
https://www.optimizesmart.com/using-multiple-trackers-for-cross-domain-tracking-in-universal-analytics/



On Thu, Jul 27, 2017 at 8:56 AM, Richard Hayes <[hidden email]> wrote:
Hello,

What is the current state of the art for adding additional Google Analytics user accounts to JBrowse traffic reporting? We're hoping to enable page view tracking while leaving the JBrowse.org account intact.

There is discussion in https://github.com/GMOD/jbrowse/issues/589 from 2015 but that seems possibly out of date.

I tried:
1) a patch to Browser.js that adds to _reportGoogleUsageStats():
    if (this.config.self_google_analytics_account) {
        _gaq.push(['b._setAccount', this.config.self_google_analytics_account]);
        _gaq.push(['b._trackPageview']);
    }

2) Switching to analytics.js from now legacy ga.js.

3) As Vivek also suggested in 2015 (https://github.com/Arabidopsis-Information-Portal/jbrowse/blob/stable/index.html#L109-L130), I last tried setting suppressUsageStatistics to true and adding my own analytics call, both at the end of the main JBrowse function as above, or in it's own <script> to the end of <head> in index.html. Admittedly, this should also have worked, but does not. I've verified that the UA ID is correct though (we track other areas of our site with the same simple <script> statement).

I don't see jbrowse/index.html traffic in the Google real time content pane for any of these variations.

Any suggestions? Loading ga.js twice supposedly kills all reporting, so I'm next looking to see if that is inadvertantly happening.

I will build a pull request around a working solution with a new optional self_google_analytics_account global parameter.

Best regards,

Richard D. Hayes, Ph.D.
Joint Genome Institute / Lawrence Berkeley National Lab
http://phytozome.jgi.doe.gov

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Google Analytics Advice

nathandunn

Its pretty dead simple.  

https://github.com/GMOD/Apollo/blob/master/grails-app/views/google_analytics.gsp

Mine is in a JSP/ GSP where grailsApplication.config.apollo.google_analytics is just an array of analytic ids and the snippet is whatever google gave me at the time.

I think it could be done as simply in JBrowse, as well.

Nathan

> On Aug 1, 2017, at 10:31 PM, Richard Hayes <[hidden email]> wrote:
>
> Is that apollo code change something easily retrofitted to non-apollo jbrowse?
>
> I was going to try a joint account setup again with analytics.js, but not all of the current stock jbrowse metrics are necessarily easily ported over from ga.js analytics, I think. Happy to be wrong there.
>
> On Aug 1, 2017 9:34 PM, "Nathan Dunn" <[hidden email]> wrote:
>
> For Apollo we treated the analytics ID as an array and so could loop through as many analytics accounts as necessary (by default being just our internal Apollo one).
>
> For all of the plugin authors and the JBrowse out there, please don’t remove the JBrowse tracking!
>
> Nathan
>
>> On Aug 1, 2017, at 6:24 PM, Eric Yao <[hidden email]> wrote:
>>
>> Thanks for looking into this.  I came across this, which is an extension of Vivek's code.  Would something like this work?
>> https://www.optimizesmart.com/using-multiple-trackers-for-cross-domain-tracking-in-universal-analytics/
>>
>>
>>
>> On Thu, Jul 27, 2017 at 8:56 AM, Richard Hayes <[hidden email]> wrote:
>> Hello,
>>
>> What is the current state of the art for adding additional Google Analytics user accounts to JBrowse traffic reporting? We're hoping to enable page view tracking while leaving the JBrowse.org account intact.
>>
>> There is discussion in https://github.com/GMOD/jbrowse/issues/589 from 2015 but that seems possibly out of date.
>>
>> I tried:
>> 1) a patch to Browser.js that adds to _reportGoogleUsageStats():
>>     if (this.config.self_google_analytics_account) {
>>         _gaq.push(['b._setAccount', this.config.self_google_analytics_account]);
>>         _gaq.push(['b._trackPageview']);
>>     }
>>
>> 2) Switching to analytics.js from now legacy ga.js.
>>
>> 3) As Vivek also suggested in 2015 (https://github.com/Arabidopsis-Information-Portal/jbrowse/blob/stable/index.html#L109-L130), I last tried setting suppressUsageStatistics to true and adding my own analytics call, both at the end of the main JBrowse function as above, or in it's own <script> to the end of <head> in index.html. Admittedly, this should also have worked, but does not. I've verified that the UA ID is correct though (we track other areas of our site with the same simple <script> statement).
>>
>> I don't see jbrowse/index.html traffic in the Google real time content pane for any of these variations.
>>
>> Any suggestions? Loading ga.js twice supposedly kills all reporting, so I'm next looking to see if that is inadvertantly happening.
>>
>> I will build a pull request around a working solution with a new optional self_google_analytics_account global parameter.
>>
>> Best regards,
>>
>> Richard D. Hayes, Ph.D.
>> Joint Genome Institute / Lawrence Berkeley National Lab
>> http://phytozome.jgi.doe.gov
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Gmod-ajax mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gmod-ajax
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
>> Gmod-ajax mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/gmod-ajax
>
>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gmod-ajax mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-ajax
Loading...