Add Tracking to Blog.mozilla.org nav

RESOLVED FIXED

Status

mozilla.org
Webdev
RESOLVED FIXED
2 years ago
a year ago

People

(Reporter: pgerman, Assigned: craigcook)

Tracking

Details

(Reporter)

Description

2 years ago
Please add the following to the blog.mozilla.org nav.

Expand Nav
ga('send', 'event', '<blogname> Interactions', 'nav click', 'nav-open');

Search
ga('send', 'event', '<blogname> Interactions', 'nav click', 'search:<term>');

Categories (ex. Internet issues > Decentralization)
ga('send', 'event', '<blogname> Interactions', 'nav click', 'Category:<Nav link text>');

Recent Posts
ga('send', 'event', '<blogname> Interactions', 'nav click', 'Recent Post:<article name>');
(Assignee)

Updated

2 years ago
Assignee: nobody → craigcook.bugz
(Assignee)

Comment 1

a year ago
(In reply to pgerman from comment #0)
 
> Recent Posts
> ga('send', 'event', '<blogname> Interactions', 'nav click', 'Recent
> Post:<article name>');

Can you clarify what part of the page this refers to? There's the bar with links to next and previous posts, a list of related posts in the same category, and a list of popular posts (determined by pageviews). Listing popular posts relies on a plugin but if that plugin isn't active it falls back to displaying the ten most recent posts, which I assume is what you were referring to originally.

We can track clicks on all of these separately if you like. That might be good since in some cases we'll have duplicate links, e.g. a popular post that is also in the same category.
Flags: needinfo?(pgerman)
(Reporter)

Comment 2

a year ago
Recent Posts refers to this-> https://pageshot.net/iy12g1wMlbFjvRa6/blog.mozilla.org

My understanding is that we're going to limit scope to the hamburger nav. If you have bandwidth to do more, that'd be great, and I can make more robust requirements.
Flags: needinfo?(pgerman)
(Assignee)

Comment 3

a year ago
Ah I see the source of confusion now: that bit doesn't exist on the main blog (https://blog.mozilla.org), that's from the Internet Citizen blog (https://blog.mozilla.org/internetcitizen/) which uses a third-party theme.
(Assignee)

Comment 4

a year ago
Alright, so after realizing we were looking at different blogs I think I can get us on the same page (literally) and still add some extra bits outside the main nav. I've tagged them differently, hopefully to make it easier to generate separate reports, but correct me if I'm wrong.

For the actual global navbar, with links to "Internet Health", "Web Innovations", "Donate", and "Firefox" I've set it up as:

ga('send', 'event', '<blog name> Interactions', 'nav click', 'Global nav: <link text>');


And for other parts of the page I've added:

// Open explore drawer
ga('send', 'event', '<blog name> Interactions', 'explore click', 'explore-open');

// Change explore category
ga('send', 'event', '<blog name> Interactions', 'explore click', 'Explore category: <category text>');

// Click a post in Explore
ga('send', 'event', '<blog name> Interactions', 'explore click', 'Explore link: <post title>');

// Search terms
ga('send', 'event', '<blog name> Interactions', 'search', 'Search: <terms>');

// Click previous post
ga('send', 'event', '<blog name> Interactions', 'prev/next click', 'Previous: <post title>');

// Click next post
ga('send', 'event', '<blog name> Interactions', 'prev/next click', 'Next: <post title>');

// Click a post in category
ga('send', 'event', '<blog name> Interactions', 'related click', 'In category: <post title>');

// Click a popular post
ga('send', 'event', '<blog name> Interactions', 'related click', 'Popular: <post title>');

// Click a recent post (only seen if popular posts is disabled)
ga('send', 'event', '<blog name> Interactions', 'related click', 'Recent: <post title>');


Am I doing this right? I don't know if I can just make up event buckets like this so let me know if you need something different. I also don't know if this is going overboard with too many separate things to track. If this looks alright I can put it onto a test blog first so we can verify things are working properly before I push it to production.
Flags: needinfo?(pgerman)
(Reporter)

Comment 5

a year ago
Craig, that looks amazing. Thanks for taking initiative to close the gaps.
Flags: needinfo?(pgerman)
(Assignee)

Comment 6

a year ago
I've pushed the changes to a test site at https://testmozilla.wpengine.com/newmozblog/. Can you verify the events are showing up in GA? (I've also temporarily turned on GA for testmozilla; we usually don't have analytics running there.)
Flags: needinfo?(pgerman)
(Reporter)

Comment 7

a year ago
I cleared my cache, it works. Can you add something similar to explore drawer open on the browse menu?

// Open explore drawer
ga('send', 'event', '<blog name> Interactions', 'explore click', 'Sidebar-open');
(Assignee)

Comment 8

a year ago
This has been in production for a few days.
Status: NEW → RESOLVED
Last Resolved: a year ago
Flags: needinfo?(pgerman)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.