Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer Home: Add MC stats and tracks events to all the links #35563

Merged
merged 6 commits into from
Aug 22, 2019

Conversation

pablinos
Copy link
Contributor

Changes proposed in this Pull Request

This change adds Tracks events and bumps MC stats for each link on the
page. It passes whether the site is using a static homepage to the
Tracks events, because we are planning on showing different links to
people based on this option, and we may want to segment the data by it.

Testing instructions

Turn on debug for analytics using:

localStorage.setItem('debug', "calypso:analytics:mc,calypso:analytics:tracks")

in your browser console.

Click on the various links on the customer home page and check the logs in the console. You should see events being tracked of the form

calypso:analytics:tracks Recording event "calypso_customer_home_earn_share_site_click" with actual props 
Object { isStaticHomePage: true, environment: "development", environment_id: "development", site_count: 155, site_id_label: "wpcom", client: "browser" }
calypso:analytics:mc Bumping stat calypso_customer_home:earn_share_site +1h

@pablinos pablinos requested a review from eliorivero August 19, 2019 16:23
@pablinos pablinos self-assigned this Aug 19, 2019
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Aug 19, 2019

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~375 bytes added 📈 [gzipped])

name  parsed_size           gzip_size
home      +1465 B  (+0.6%)     +375 B  (+0.6%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

This change adds Tracks events and bumps MC stats for each link on the
page. It passes whether the site is using a static homepage to the
Tracks events, because we are planning on showing different links to
people based on this option, and we may want to segment the data by it.
@pablinos pablinos force-pushed the add/customer-home-analytics branch from ea00f86 to be85e79 Compare August 20, 2019 15:23
pablinos and others added 4 commits August 20, 2019 16:29
When a site sets the option to display posts on the homepage, the
buttons to edit the homepage are not appropriate. This change checks the
value of the option for the site and swaps the two of the buttons, so
the user additionally has a link to manage their comments.
Customer Home: Update links when the site displays posts on the homepage
page( `/post/${ siteSlug }` );
} }
>
{ translate( 'Write Blog Post' ) }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I've found a possible matching string that has already been translated 4 times:
translate( 'Write blog post' ) ES Score: 9
See 1 additional suggestion in the PR translation status page

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).

trackAction( 'my_site', 'manage_comments' );
page( `/comments/${ siteSlug }` );
} }
label={ translate( 'Manage comments' ) }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! I've found a possible matching string that has already been translated 140 times:
translate( 'Manage Comments' ) ES Score: 9

Help me improve these suggestions: react with 👎 if the suggestion doesn't make any sense, or with 👍 if it's a particularly good one (even if not implemented).

@pablinos pablinos added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 21, 2019
Copy link
Contributor

@eliorivero eliorivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@eliorivero eliorivero merged commit 3ef259c into master Aug 22, 2019
@eliorivero eliorivero deleted the add/customer-home-analytics branch August 22, 2019 01:13
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants