[PULSE-11] Add Campaigns report to dashboard #6
Reference in New Issue
Block a user
No description provided.
Delete Branch "staging"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Work Item
PULSE-11
Summary
Added a new "Campaigns" section to the site dashboard to visualize marketing performance based on UTM parameters.
Changes
Campaignscomponent to display a list of campaigns (Source, Medium, Campaign) with visitor counts.Campaignscomponent into the main site dashboard (/sites/[id]).getCampaignsfunction to fetch data from the new backend endpoint.Test Plan
[ ] Visit a site dashboard with existing campaign data and verify the table renders correctly.
[ ] Visit a site dashboard with NO campaign data and verify the empty state (megaphone icon + instructions) appears.
[ ] Click "View All" (if enough data exists) to verify the modal opens and displays the full list.
Greptile Overview
Greptile Summary
This PR adds a new Campaigns section to the site dashboard for tracking marketing performance via UTM parameters (
utm_source,utm_medium,utm_campaign).Key Changes:
Campaignscomponent displaying campaign statistics in a table format with source, medium, campaign name, and visitor countsgetCampaigns()andgetPublicCampaigns()API functions following existing patterns in the codebaseImplementation Quality:
The implementation follows established patterns from similar components like
TopReferrersandContentStats. The component properly handles loading states, modal views for expanded data, and gracefully displays an informative empty state with user guidance.Confidence Score: 4.5/5
Important Files Changed
getCampaignsandgetPublicCampaignsAPI functions with proper TypeScript typing and URLSearchParams handlingSequence Diagram
3 files reviewed, 1 comment
Edit Code Review Agent Settings | Greptile
@@ -0,0 +53,4 @@} else {setFullData([])}}, [isModalOpen, siteId, dateRange])The modal fetches the same data that's already loaded in
data. Either reuse the existingdatastate, or if you need to fetch more records (with a higher limit), modifygetCampaignsto accept alimitparameter like other API functions in the codebase (getTopReferrers,getTopPages, etc.).Prompt To Fix With AI