Customizing the Bearblog analytics page
(This is relevant only for paid accounts with in-depth analytics.)
I was curious to see if I could customize my analytics page to hide everything but the referrers. Some Bearbloggers are interested in hiding metrics, so I thought I'd share what worked for me.
Here's the CSS I added to Dashboard > Customize dashboard > Dashboard styles:
/* Hide everything but referrers */
main:has(canvas#hitsChart) h1 + p,
canvas#hitsChart,
canvas#hitsChart + .helptext ~ p,
canvas#hitsChart + .helptext ~ p + div > div:first-child,
canvas#hitsChart + .helptext ~ p + div + div,
canvas#hitsChart + .helptext ~ p + div > div ul li span:last-child {
display: none !important;
}
/* Resize referrers to fill page */
canvas#hitsChart + .helptext ~ p + div > div:last-child {
width: 100% !important;
}
canvas#hitsChart + .helptext ~ p + div > div:last-child ul {
max-height: initial !important;
}
À la carte
To hide metrics only:
/* Numbers */
canvas#hitsChart + .helptext ~ p ~ div > div ul li span:last-child { display: none; }
/* Upvotes */
canvas#hitsChart + .helptext ~ p + div > div:first-child ul li span small { display: none; }
/* Reading now */
main:has(canvas#hitsChart) h1 + p { display: none; }
/* Unique reads + unique visitors */
canvas#hitsChart + .helptext ~ p { display: none; }
/* The graph */
canvas#hitsChart { display: none !important; }
To hide specific sections:
/* Pages */
canvas#hitsChart + .helptext ~ p + div > div:first-child { display: none; }
/* Referrers */
canvas#hitsChart + .helptext ~ p + div > div:last-child { display: none; }
/* Devices */
canvas#hitsChart + .helptext ~ p + div + div > div:first-child { display: none; }
/* Browsers */
canvas#hitsChart + .helptext ~ p + div + div > div:nth-child(2) { display: none; }
/* Countries */
canvas#hitsChart + .helptext ~ p + div + div > div:last-child { display: none; }
Since the analytics page doesn't have a unique class, I found the most unique thing on it (the graph) and used it to target other elements on the page with the sibling & child combinators. The selectors are specific to avoid accidentally hiding other dashboard things.