serp-ctr
Search-console arithmetic in safe, dependency-free Rust: click-through rate, impression-weighted average position, SERP page bucketing, pooled totals, and click projection against a CTR-by-position curve.
Why there is no built-in CTR table
Published "average CTR by position" tables are third-party estimates that disagree with
each other and vary by query intent and SERP layout. Baking one in would turn somebody
else's sample into this crate's constant. CtrCurve is therefore built from your
observations, and it returns an error for a position it has never seen rather than
interpolating one.
use ;
// 7 clicks on 1,000 impressions
assert_eq!;
// Impression-weighted, not a mean of the position column
let rows = ;
assert!;
// Curve built from measured rows, then used to restate them at a new volume
let curve = from_observations.unwrap;
assert_eq!;
assert!; // never observed, so never guessed
Install
[]
= "0.1"
#![forbid(unsafe_code)], no dependencies, MSRV 1.63.
Licence
MIT OR Apache-2.0.
Written for the SEO pipeline at https://toolsthatrank.com/.