samvera-labs / hydra_plugins_wg

Work area for the Hydra Plugins Working Group
Apache License 2.0
1 stars 0 forks source link

Create repo for Google Analytics Hydra plugin #14

Closed afred closed 7 years ago

afred commented 7 years ago

done when repo is created under projecthydra-labs.

mbarnett commented 7 years ago

Possibly useful, possibly useless code for when we embark on this: I worked on rack middleware for google analytics support a couple of years ago, which is transparent to apps that don't opt into it: https://github.com/mbarnett/rack-universal-analytics

The group should feel free to steal from or ignore it as they see fit.

starsplatter commented 7 years ago

The blacklight GA gem:

https://github.com/jronallo/blacklight_google_analytics

afred commented 7 years ago

Thanks @starsplatter.

@projecthydra-labs/hydra_plugins_wg: The fact this existed as a Blacklight plugin makes me wonder to what degree it needs to interface with any Hydra-specific layer. Can anyone think of a reason this shouldn't stay at the Blacklight level?

starsplatter commented 7 years ago

Dashboard integration is the main thing I can think of.

mbarnett commented 7 years ago

There's no reason per se this can't stay at the blacklight level, because that's the level at which this gem wants to work. It's hardcoded to track specific hardcoded events based on some assumptions about a stock Blacklight catalog page's HTML. It doesn't really seem to be designed to be extensible by other layers -- it's narrowly focused on blacklight.

We have a hydra head locally that needs to do a lot more than what this gem does, but we don't bother with trying to interface with this, we roll our own implementation. We could theoretically use this by overriding several of its viewpaths, but it doesn't really go out of its way to be easily extensible by higher layers and there's not much point to having it as a dependency if we overwrite most of it.

mbarnett commented 7 years ago

It looks like Sufia rolls its own GA implementation rather than trying to hook into this, as well.

I guess the question is, are we looking to turn blacklight_google_analytics into an example of a plugin that can be hooked into at higher layers, so that we could realistically use this in our own hydra head to do more than what it does out of the box? Or is it fine as-is as an example of something that only makes sense in a narrow blacklight-oriented use-case?

afred commented 7 years ago

I haven't looked yet at Sufia's GA stuff, but I assume that's where we'll start when trying to turn it into a plugin. So to whatever degree it's interfacing with other layers of the Hydra stack, I'm guessing we'll start by mimicking that.

That's good enough reason for me

starsplatter commented 7 years ago

Yeah, the Blacklight GA link was just meant to be an example, not a direction.

starsplatter commented 7 years ago

At the moment, I'm not able to do this. I just finally got my iCLA done yesterday, so maybe now I can be added to a group that would let me do so?

afred commented 7 years ago

@starsplatter try now

starsplatter commented 7 years ago

I was unable to find guidance on naming, but we can rename if what I chose isn't okay. And thanks! https://github.com/projecthydra-labs/google_analytics_plugin