brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.53k stars 2.27k forks source link

[ads] Beautify database query formatting #32742

Closed tmancey closed 6 months ago

btlechowski commented 4 months ago

Verified with

Brave 1.65.96 Chromium: 123.0.6312.86 (Official Build) beta (64-bit)
Revision 5d9143e1a0812c53bdc27fd5384591254306a88c
OS Linux

Notification ads - maximum_ads_per_day

``` [5217:5217:0403/171440.935689:VERBOSE2:permission_rules.cc(209)] You have exceeded the allowed notification ads per day [5217:5217:0403/171440.936042:VERBOSE1:notification_ad_serving.cc(77)] Notification ad not served: Not allowed due to permission rules ``` after browser restart: ``` [5595:5595:0403/171531.229872:VERBOSE2:permission_rules.cc(209)] You have exceeded the allowed notification ads per day [5595:5595:0403/171531.230093:VERBOSE1:notification_ad_serving.cc(77)] Notification ad not served: Not allowed due to permission rules ``` released: ``` [6056:6056:0404/171627.841092:VERBOSE1:notification_ad_handler.cc(184)] Served notification ad: placementId: 9ed053e5-4943-4829-9d76-c5fb3d2c24fe creativeInstanceId: 94464eab-dae5-4e4e-9d93-d5b2d0aeb724 creativeSetId: 586d9c8f-9573-4eac-8d66-c002615f7514 campaignId: d1e25388-b362-4f30-bd4b-36b8205e59e5 advertiserId: a34de75d-5654-4331-8713-8f4d4e2b6bf7 segment: untargeted title: Vivamus sagittis lacus vel aug body: Duis mollis, est non commodo luctus, nisi erat porttitor lig targetUrl: https://www.apple.com/ ```

ntpsi - maximum_ads_per_day

``` [23819:23819:0403/195739.443535:VERBOSE2:permission_rules.cc(157)] You have exceeded the allowed new tab page ads per day [23819:23819:0403/195739.444074:VERBOSE1:new_tab_page_ad_serving.cc(43)] New tab page ad not served: Not allowed due to permission rules ``` released: ``` [24079:24079:0404/195813.329750:VERBOSE1:new_tab_page_ad_handler.cc(169)] Served new tab page ad: placementId: 22854a71-6638-455c-b4bb-f00882691b8a creativeInstanceId: 0aaafcc8-2c2c-45e1-bf89-9244d3c331d0 creativeSetId: b03f540a-d70a-432c-af2d-10702fa6cc7e campaignId: 10477b6c-eac9-4ef3-8f3b-caf4e8e83e07 advertiserId: 803953a8-56b4-4d4b-942a-fa81357f1427 segment: untargeted companyName: BMW imageUrl: https://mobile-data-dev.s3.brave.software/assets/ntp-si/69aa9044-d6d2-4e24-ac03-958391b2bb7a.png alt: BMW targetUrl: https://www.bmwusa.com/?brave-creative-id=0aaafcc8-2c2c-45e1-bf89-9244d3c331d0&source=image1 wallpaper: imageUrl: https://mobile-data-dev.s3.brave.software/assets/ntp-si/72ba7af0-160e-4b1b-bdec-5ae0d166f7e1.jpg focalPoint: x: 756 y: 720 ```

Brave news inline ads - maximum_ads_per_day

``` [26038:26038:0403/201135.236203:VERBOSE2:permission_rules.cc(316)] You have exceeded the allowed inline content ads per day [26038:26038:0403/201135.236850:VERBOSE1:inline_content_ad_serving.cc(48)] Inline content ad not served: Not allowed due to permission rules ``` released: ``` [26298:26298:0404/201210.894193:VERBOSE1:inline_content_ad_handler.cc(183)] Served inline content ad: placementId: 758bef1a-3395-4518-89db-dd1544992ca1 creativeInstanceId: 211a9ff9-48bf-4b79-bd2a-f6b450edac0a creativeSetId: 8b848823-c47f-43de-a753-2efa8dea6863 campaignId: 07de7f05-ab32-4af0-a350-a1bce4427eac advertiserId: 93130af3-2def-4ecb-b836-b3772e73b3c9 segment: untargeted title: [Staging] Aspect Ratio description: Test Aspect Ratio imageUrl: https://pcdn.bravesoftware.com/brave-news-ads/0f61aa5e-d79f-4585-9835-b75afb3343b0.jpg.pad dimensions: 900x750 ctaText: Aspect Ratio targetUrl: https://brave.com/careers/ ```

ads viewed in panel after upgrade

Verified ads viewed were update correctly from 1.64.x ![image](https://github.com/brave/brave-browser/assets/34715963/87420cbb-676d-4615-9484-b17018cceef1)

notification ads after upgrade

Notification ads were shown: ![image](https://github.com/brave/brave-browser/assets/34715963/f76c875e-9f24-4d38-8126-947371671009)

inline ads after upgrade

inline ads were shown: ![image](https://github.com/brave/brave-browser/assets/34715963/4e9002ce-0cce-44a6-ac49-f13ccf966d99)

new tab ads after upgrade

new tab ads were shown: ![image](https://github.com/brave/brave-browser/assets/34715963/4b520dd2-1f05-41c3-9724-d0b90b9ec940)

conversion queue

Verified conversion was scheduled ``` [7251:7251:0403/172735.232689:VERBOSE1:conversions.cc(186)] Conversion for ad_notification with creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed, creative set id 5f8c4787-8431-49a5-9d09-bba40f8ad5f4, campaign id d1e25388-b362-4f30-bd4b-36b8205e59e5 and advertiser id a34de75d-5654-4331-8713-8f4d4e2b6bf7 [7251:7251:0403/172735.233529:VERBOSE9:client_state_manager.cc(471)] Successfully saved client state [7251:7251:0403/172735.271689:VERBOSE1:conversions.cc(230)] Successfully added view verifiable conversion for ad_notification with creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed, creative set id 5f8c4787-8431-49a5-9d09-bba40f8ad5f4, campaign id d1e25388-b362-4f30-bd4b-36b8205e59e5 and advertiser id a34de75d-5654-4331-8713-8f4d4e2b6bf7 to the queue [7251:7251:0403/172735.271689:VERBOSE1:conversions.cc(255)] Process view verifiable conversion for ad_notification with creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed, creative set id 5f8c4787-8431-49a5-9d09-bba40f8ad5f4, campaign id d1e25388-b362-4f30-bd4b-36b8205e59e5 and advertiser id a34de75d-5654-4331-8713-8f4d4e2b6bf7 in 0 hours, 1 minute, 0 seconds at 17:28:35.271 ``` Conversion was resumed after browser restart ``` [7733:7733:0403/172937.384423:VERBOSE1:conversions.cc(267)] Successfully processed view verifiable conversion for ad_notification with creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed, creative set id 5f8c4787-8431-49a5-9d09-bba40f8ad5f4, campaign id d1e25388-b362-4f30-bd4b-36b8205e59e5 and advertiser id a34de75d-5654-4331-8713-8f4d4e2b6bf7 [7733:7733:0403/172937.400418:VERBOSE3:account.cc(151)] Successfully processed deposit for ad_notification with creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed and conversion valued at 0 [7733:7733:0403/172937.400702:VERBOSE1:confirmations.cc(44)] Confirming conversion for ad_notification with transaction id ea316f50-75c3-413f-917b-62100499986c and creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed ``` Conversion confirmation was successful ``` [7733:7733:0403/172951.134528:VERBOSE1:confirmations.cc(110)] Successfully processed conversion confirmation for ad_notification with transaction id ea316f50-75c3-413f-917b-62100499986c and creative instance id 4cda3ae7-1f70-4bca-b361-ca01d6a8f1ed ```

upgrade from 1.64.x to 1.65.x

1.64.x ``` "confirmations": { "queue": [{ "ad_type": "ad_notification", "blinded_payment_token": "BhbeTOGWe68pL0m8ojOv9r5/CBwiLwejzCmW1OW/o0g=", "created_at": "13357664796811018", "creative_instance_id": "dfa7f654-04a9-4012-a1c5-632c017ebefe", "credential": "eyJzaWduYXR1cmUiOiJHSzlySnRSTWZ1dXVMK2cyVGJkMERSOWdQRy9EekFlMUFSMEk5R3l4cUZDQ2tPSlA3ZGgyKzZsUmxHVm1EZnZid1VqUVlLVmFpaWlBSkNib1hwNDNpZz09IiwidCI6IjZYT0FSMWNseEZFT2pOcnVZanhxUEpwQjhpSExQemxydXBXa3JTZ2JIUk5wNnZSNXVLc2E1SWFxaXIzM3FjL2h1dTdRZXBDZERxQkRMVGo0dDBLRjlBPT0ifQ==", "payment_token": "daQff6LxksZN0fHOi0ca/x/xXMTvqBv9vAmHYTRHM6e6DnXAvWz72xCoBvKRnzYmlHE6dGZrBQXJU2xQg1MPRxBkQMlAxNjhkvEUnMiWudeZHtUnc4Vm6//LU+ehpZkE", "token_info": { "public_key": "hLaC3RQw5++hx8zaT+47CA8r8cOlAm+ygeky/ci6T1s=", "signature": "rqg9e0XuuYqI7+Lb7xugqaUejfWdKQbLmfdfme8UzsNqb++ZpJrPBfqGNejr+JCWgZXXSoyKQ8xhhu2bMU9MDA==", "unblinded_token": "6XOAR1clxFEOjNruYjxqPJpB8iHLPzlrupWkrSgbHRNp6vR5uKsa5Iaqir33qc/huu7QepCdDqBDLTj4t0KF9DJpCLRCaXChKbjWwgrb/3osxbT3f8sDne4uhbwCFVs2" }, "transaction_id": "88d8bcc0-63ec-460a-ac1f-ffe7a515e88d", "type": "view", "user_data": { "buildChannel": "release", "catalog": [{ "id": "Qe8YEfnFwze9zrk7kq7i7YCZZEH4bUfM9DrwrXmDZ1E=" } ], "countryCode": "US", "createdAtTimestamp": "2024-04-15T14:00:00.000Z", "platform": "linux", "rotating_hash": "Qy14TTO1kZK43j4/oVhRSLPzBDd4bldGN+vzbOTOYtI=", "segment": "untargeted", "studies": [], "topSegment": [], "versionNumber": "123.0.6312.122" } } ] }, ``` 1.65.x ![image](https://github.com/brave/brave-core/assets/34715963/9fe15444-8a72-4209-ba13-c03960e3c35f)