MinnPost / minnpost-wordpress

MinnPost.com in WordPress
GNU General Public License v2.0
2 stars 0 forks source link

Google Analytics #29

Closed jonathanstegall closed 6 years ago

jonathanstegall commented 6 years ago

At least do what we're currently doing in Drupal.

jonathanstegall commented 6 years ago

I kind of assume that not all of the tracking will be identical to how it is in Drupal. But I think it's important to document whatever differences there are as part of this issue.

jonathanstegall commented 6 years ago

Custom things we need to track that do not require a plugin:

Custom dimensions ✅

User status: ✅

Object info: ✅

Custom Events

Direct Messages

Category is DirectedMessage. Action is dismiss, close button, login link, or click. Label is the current URL with the message ID. Ex: window.location.hostname + '/node/' + message.nid.

Still have to build these.

Member content ✅

For users who cannot access, we currently track. Category is MinnPost+, Action is Blocked, label is the URL they were trying to access. This is maybe redundant with the dimensions, but that is what it currently does. We could probably also track users who do access.

I've changed this to: Category = Member Content; Action = Blocked or Shown; label is URL they're trying to access. This allows us to also count the other benefit pages.

MailChimp ✅

For users who fill out the form that submits via Ajax, the Category is Newsletter, the Action is Signup or Fail, the Label is the URL where the user was when they filled out the form.

Share ✅

When a user clicks a share button, the Category is Share - Top or Share - Bottom, the Action is the text of the button, and the Label is the URL where they clicked the button.

If it is a Twitter or Facebook button they are also tracked as "social" events.

Support ✅

When user submits the form on /support or /support/member-benefits, the Category is Support Us, the Action is Become A Member, and the Label is the URL where they clicked.

Using an adblocker ✅

Menu links to track ✅

Common events ✅

Other events ✅

internal search ✅

(this gets setup in analytics)

adsense? ✅

(cms doesn't manage this)

jonathanstegall commented 6 years ago

Note that we don't need to store the URL path on ScrollDepth events because we can just use it as a secondary dimension. Probably should've always done that, but whatever.

jonathanstegall commented 6 years ago

Custom things to track that require a plugin:

Scroll Depth ✅

jonathanstegall commented 6 years ago

It would really be nice to use https://github.com/googleanalytics/autotrack but I think it won't do everything we need, if only for scrolling. It does not appear to allow tracking when users scroll to specific HTML elements.

jonathanstegall commented 6 years ago

If we continue to use the ScrollDepth plugin, we should pass this link around so everyone understands it better. https://medium.com/google-analytics/hacking-google-analytics-24762924fbf8

Maybe also this: http://www.ryanpraski.com/scroll-depth-tracking-analysis-with-google-analytics-r/

jonathanstegall commented 6 years ago

Autotrack will work fine because it has a different plugin from the scroll plugin that tracks when elements are visible. But not really because it is just too complicated to deal with configuring everything within WordPress right now.

jonathanstegall commented 6 years ago

Hash links ✅

jonathanstegall commented 6 years ago

I'm inclined to think the remaining custom event tracking should go into its respective plugins, or into the theme, because they're not generic enough to be universal to this plugin.