0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-07 13:19:19 +08:00
discourse/plugins/discourse-adplugin/spec/fabricators/ad_impressions_fabricator.rb
Juan David Martínez Cubillos cc7f4743a5
FEATURE: Implement ad impressions tracking (#35797)
**Description**

This PR implements these features:
 - Impressions tracking for HouseAds and External Ads
 - Click tracking for HouseAds and External Ads
- Reports of HouseAds performance, ad impressions by user, general ad
impressions, conversion reports by ad and placement, conversion reports
by ad type, and conversion reports by placement.

As part of implementing these features, the HouseAd model had to be
pulled out of the Plugin rows table into its own table. Refactoring had
to be done to account for these changes.

---------

Co-authored-by: Bannon Tanner <bannon.n.tanner@gmail.com>
2025-12-01 12:17:25 -05:00

19 lines
619 B
Ruby
Vendored

# frozen_string_literal: true
Fabricator(:house_ad_impression, from: "AdPlugin::AdImpression") do
ad_type { AdPlugin::AdType.types[:house] }
placement { AdPlugin::HouseAdSetting::DEFAULTS.keys[0].to_s }
house_ad
user
end
Fabricator(:anonymous_house_ad_impression, from: "AdPlugin::AdImpression") do
ad_type { AdPlugin::AdType.types[:house] }
placement { AdPlugin::HouseAdSetting::DEFAULTS.keys[0].to_s }
house_ad
end
Fabricator(:external_ad_impression, from: "AdPlugin::AdImpression") do
ad_type { AdPlugin::AdType.types[:amazon] }
placement { AdPlugin::HouseAdSetting::DEFAULTS.keys[0].to_s }
end