diff --git a/apps/app/src/api/ads.rs b/apps/app/src/api/ads.rs index 463397c65..0a3028e1d 100644 --- a/apps/app/src/api/ads.rs +++ b/apps/app/src/api/ads.rs @@ -17,7 +17,15 @@ pub struct AdsState { const AD_LINK: &str = "https://modrinth.com/wrapper/app-ads-cookie"; #[cfg(not(target_os = "linux"))] -const ADS_USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"; +const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); +#[cfg(not(target_os = "linux"))] +const ADS_USER_AGENT: &str = concat!( + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ", + "(KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36 ", + "ModrinthApp/", + APP_VERSION, + " (Modrinth App)", +); #[cfg(windows)] fn ads_user_agent_override_params() -> String { @@ -28,12 +36,14 @@ fn ads_user_agent_override_params() -> String { "brands": [ { "brand": "Chromium", "version": "128" }, { "brand": "Google Chrome", "version": "128" }, + { "brand": "Modrinth App", "version": APP_VERSION }, { "brand": "Not=A?Brand", "version": "99" }, ], "fullVersion": "128.0.0.0", "fullVersionList": [ { "brand": "Chromium", "version": "128.0.0.0" }, { "brand": "Google Chrome", "version": "128.0.0.0" }, + { "brand": "Modrinth App", "version": APP_VERSION }, { "brand": "Not=A?Brand", "version": "99.0.0.0" }, ], "platform": "Windows",