Skip to content

Commit ea0e1a4

Browse files
committed
fix(ahrefs): convert rank tracker competitor value/trafficValue to USD
Both bots independently flagged these two fields as inconsistent with every other monetary field in the integration, all 7 of which are explicitly documented as USD cents. Neither field has explicit unit documentation (one is undocumented as cents, the other's schema isn't statically retrievable at all), but given the unanimous pattern across every other verified field and no contrary evidence, converting for consistency is the better bet than leaving them as an outlier.
1 parent e4dcffc commit ea0e1a4

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/docs/content/docs/en/integrations/ahrefs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ Get competitor rankings for the keywords tracked in an Ahrefs Rank Tracker proje
633633
|`position` | number | Current ranking position |
634634
|`bestPositionKind` | string | Type of the best position achieved |
635635
|`traffic` | number | Estimated traffic to the competitor |
636-
|`value` | number | Estimated traffic value |
636+
|`value` | number | Estimated traffic value \(USD\) |
637637

638638
### `ahrefs_rank_tracker_competitors_stats`
639639

@@ -656,7 +656,7 @@ Get aggregate competitor stats for an Ahrefs Rank Tracker project: each competit
656656
| `competitorsStats` | array | Aggregate stats for each tracked competitor |
657657
|`competitor` | string | The competitor's URL |
658658
|`traffic` | number | Estimated monthly organic visits |
659-
|`trafficValue` | number | Estimated monthly organic traffic value |
659+
|`trafficValue` | number | Estimated monthly organic traffic value \(USD\) |
660660
|`averagePosition` | number | Average top organic position across tracked keywords |
661661
|`pos1To3` | number | Keywords ranking in top 3 positions |
662662
|`pos4To10` | number | Keywords ranking in positions 4-10 |

apps/sim/tools/ahrefs/rank_tracker_competitors_overview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export const rankTrackerCompetitorsOverviewTool: ToolConfig<
9999
position: competitor.position ?? null,
100100
bestPositionKind: competitor.best_position_kind ?? null,
101101
traffic: competitor.traffic ?? null,
102-
value: competitor.value ?? null,
102+
value: typeof competitor.value === 'number' ? competitor.value / 100 : null,
103103
})),
104104
}))
105105

@@ -154,7 +154,7 @@ export const rankTrackerCompetitorsOverviewTool: ToolConfig<
154154
},
155155
value: {
156156
type: 'number',
157-
description: 'Estimated traffic value',
157+
description: 'Estimated traffic value (USD)',
158158
optional: true,
159159
},
160160
},

apps/sim/tools/ahrefs/rank_tracker_competitors_stats.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const rankTrackerCompetitorsStatsTool: ToolConfig<
7979
const competitorsStats = (data['competitors-metrics'] || []).map((item: any) => ({
8080
competitor: item.competitor || '',
8181
traffic: item.traffic ?? null,
82-
trafficValue: item.traffic_value ?? null,
82+
trafficValue: typeof item.traffic_value === 'number' ? item.traffic_value / 100 : null,
8383
averagePosition: item.average_position ?? null,
8484
pos1To3: item.pos_1_3 ?? 0,
8585
pos4To10: item.pos_4_10 ?? 0,
@@ -110,7 +110,7 @@ export const rankTrackerCompetitorsStatsTool: ToolConfig<
110110
},
111111
trafficValue: {
112112
type: 'number',
113-
description: 'Estimated monthly organic traffic value',
113+
description: 'Estimated monthly organic traffic value (USD)',
114114
optional: true,
115115
},
116116
averagePosition: {

0 commit comments

Comments
 (0)