Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Gutenboarding: add analytics #38871

Closed simison closed 4 years ago

simison commented 4 years ago

We'll eventually need to add analytics (at least Tracks, do we need Google Analytics?) to Gutenboarding.

Some framework type things have to happen first:

@ramonjd said:

Is there a “current” opinion on how we’ll approach analytics/tracking in Gutenboarding? That is, if we’re going to use client/lib/analytics/index.js Going over the analytics lib, I’m assuming we’ll want to pull it in, given that we’ll need many of its already-built-in methods (analytics.ga and analytics.tracks)

@jsnajdr said:

We’re working with MarTech team on cleaning up the lib/analytics library, but it goes slowly because of other priorities. Also, the lib/analytics/ad-tracking part, which is quite big and convoluted, will be almost completely replaced by Google Tag Manager. What parts of analytics will you need? Extracting Tracks and GA to @automattic/calypso-analytics shouldn’t be hard, if we leave the rest in lib/analytics.

Ad Tracking is harder. And there’s also specialized code for tracking page views.

And what do you think about the Redux analytics middleware that’s in Calypso? The lib/analytics module can be either imported and used directly, or indirectly by dispatching Redux actions. Calypso codebase prefers the Redux approach. The main advantage is for testing: no need to mock the lib/analytics library. Redux actions are dispatched and it’s up to the test code whether it handles them somehow or not.

Via p1579140697040600-slack-gutenboarding

ramonjd commented 4 years ago

Related issue: https://github.com/Automattic/wp-calypso/issues/38799

simison commented 4 years ago

@ramonjd I think we can just use your issue to track this. Sorry I missed it earlier!