@gscdump/analysis 0.21.3 → 0.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3470,7 +3470,7 @@ const opportunityAnalyzer = defineAnalyzer({
3470
3470
  const w1 = 1;
3471
3471
  const w2 = 1;
3472
3472
  const w3 = 1;
3473
- const totalW = w1 + w2 + w3;
3473
+ const totalW = 3;
3474
3474
  const limit = params.limit ?? 1e3;
3475
3475
  return {
3476
3476
  sql: `
@@ -3591,7 +3591,7 @@ const opportunityAnalyzer = defineAnalyzer({
3591
3591
  const positionScore = calculatePositionScore(position);
3592
3592
  const impressionScore = calculateImpressionScore(impressions);
3593
3593
  const ctrGapScore = calculateCtrGapScore(ctr, position);
3594
- const geometricMean = (positionScore ** positionWeight * impressionScore ** impressionsWeight * ctrGapScore ** ctrGapWeight) ** (1 / (positionWeight + impressionsWeight + ctrGapWeight));
3594
+ const geometricMean = (positionScore ** positionWeight * impressionScore ** impressionsWeight * ctrGapScore ** ctrGapWeight) ** (1 / 3);
3595
3595
  const opportunityScore = Math.round(geometricMean * 100);
3596
3596
  const targetCtr = getExpectedCtr(Math.min(3, position));
3597
3597
  const potentialClicks = Math.round(impressions * targetCtr);
@@ -3464,7 +3464,7 @@ const opportunityAnalyzer = defineAnalyzer({
3464
3464
  const w1 = 1;
3465
3465
  const w2 = 1;
3466
3466
  const w3 = 1;
3467
- const totalW = w1 + w2 + w3;
3467
+ const totalW = 3;
3468
3468
  const limit = params.limit ?? 1e3;
3469
3469
  return {
3470
3470
  sql: `
@@ -3585,7 +3585,7 @@ const opportunityAnalyzer = defineAnalyzer({
3585
3585
  const positionScore = calculatePositionScore(position);
3586
3586
  const impressionScore = calculateImpressionScore(impressions);
3587
3587
  const ctrGapScore = calculateCtrGapScore(ctr, position);
3588
- const geometricMean = (positionScore ** positionWeight * impressionScore ** impressionsWeight * ctrGapScore ** ctrGapWeight) ** (1 / (positionWeight + impressionsWeight + ctrGapWeight));
3588
+ const geometricMean = (positionScore ** positionWeight * impressionScore ** impressionsWeight * ctrGapScore ** ctrGapWeight) ** (1 / 3);
3589
3589
  const opportunityScore = Math.round(geometricMean * 100);
3590
3590
  const targetCtr = getExpectedCtr(Math.min(3, position));
3591
3591
  const potentialClicks = Math.round(impressions * targetCtr);
package/dist/index.mjs CHANGED
@@ -3826,7 +3826,7 @@ const opportunityAnalyzer = defineAnalyzer$1({
3826
3826
  const w1 = 1;
3827
3827
  const w2 = 1;
3828
3828
  const w3 = 1;
3829
- const totalW = w1 + w2 + w3;
3829
+ const totalW = 3;
3830
3830
  const limit = params.limit ?? 1e3;
3831
3831
  return {
3832
3832
  sql: `
@@ -3947,7 +3947,7 @@ const opportunityAnalyzer = defineAnalyzer$1({
3947
3947
  const positionScore = calculatePositionScore(position);
3948
3948
  const impressionScore = calculateImpressionScore(impressions);
3949
3949
  const ctrGapScore = calculateCtrGapScore(ctr, position);
3950
- const geometricMean = (positionScore ** positionWeight * impressionScore ** impressionsWeight * ctrGapScore ** ctrGapWeight) ** (1 / (positionWeight + impressionsWeight + ctrGapWeight));
3950
+ const geometricMean = (positionScore ** positionWeight * impressionScore ** impressionsWeight * ctrGapScore ** ctrGapWeight) ** (1 / 3);
3951
3951
  const opportunityScore = Math.round(geometricMean * 100);
3952
3952
  const targetCtr = getExpectedCtr(Math.min(3, position));
3953
3953
  const potentialClicks = Math.round(impressions * targetCtr);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/analysis",
3
3
  "type": "module",
4
- "version": "0.21.3",
4
+ "version": "0.22.4",
5
5
  "description": "GSC analyzers — striking-distance, opportunity, movers, decay, brand, clustering, concentration, seasonality. Pure row-based + DuckDB-native.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -75,12 +75,12 @@
75
75
  },
76
76
  "dependencies": {
77
77
  "drizzle-orm": "^0.45.2",
78
- "@gscdump/engine": "0.21.3",
79
- "@gscdump/engine-gsc-api": "0.21.3",
80
- "gscdump": "0.21.3"
78
+ "@gscdump/engine": "0.22.4",
79
+ "@gscdump/engine-gsc-api": "0.22.4",
80
+ "gscdump": "0.22.4"
81
81
  },
82
82
  "devDependencies": {
83
- "vitest": "^4.1.6"
83
+ "vitest": "^4.1.7"
84
84
  },
85
85
  "scripts": {
86
86
  "build": "obuild",