Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch budget recommendations from the Google Ads API #2795

Draft
wants to merge 13 commits into
base: feature/budget-recommendations
Choose a base branch
from

Conversation

mikkamp
Copy link
Contributor

@mikkamp mikkamp commented Feb 14, 2025

Changes proposed in this Pull Request:

Initial implementation for fetching Budget Recommendations from the Ads API.

It will need some additional testing because regardless of country I'm always getting the same recommendations back, which are much lower than the ones we suggest in the database tables. For example for IE we suggest 10 EUR.

Detailed test instructions:

  1. Reinstall composer dependencies rm -rf vendor && composer install
  2. Test API request https://domain.test/wp-json/wc/gla/ads/campaigns/budget-recommendation?country_codes[]=IE
  3. Observe results:
{
    "currency": "EUR",
    "recommendations": [
        {
            "daily_budget": 2.4,
            "metrics": {
                "cost": 16.8,
                "conversions": 2.8,
                "conversions_value": 111.37227762418706
            },
            "country": "IE"
        }
    ]
}

Additional details:

Project Thread:

Changelog entry

  • Add - Fetch budget recommendations from the Google Ads API.

@mikkamp mikkamp self-assigned this Feb 14, 2025
@github-actions github-actions bot added the changelog: tweak Small change, that isn't actually very important. label Feb 14, 2025
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 32.21477% with 101 lines in your changes missing coverage. Please review.

Project coverage is 66.9%. Comparing base (731d028) to head (a575a4b).

Files with missing lines Patch % Lines
src/API/Google/BudgetRecommendations.php 0.0% 82 Missing ⚠️
src/API/Google/Query/AdsCountryQuery.php 0.0% 11 Missing ⚠️
...ernal/DependencyManagement/CoreServiceProvider.php 0.0% 4 Missing ⚠️
src/Google/Ads/ServiceClientFactoryTrait.php 0.0% 2 Missing ⚠️
src/Options/TransientsAwareTrait.php 33.3% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@                        Coverage Diff                         @@
##             feature/budget-recommendations   #2795     +/-   ##
==================================================================
- Coverage                              67.2%   66.9%   -0.3%     
- Complexity                             4676    4699     +23     
==================================================================
  Files                                   480     484      +4     
  Lines                                 19569   19698    +129     
==================================================================
+ Hits                                  13155   13184     +29     
- Misses                                 6414    6514    +100     
Flag Coverage Δ
php-unit-tests 66.9% <32.2%> (-0.3%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Controllers/Ads/BudgetRecommendationController.php 100.0% <100.0%> (ø)
...nal/DependencyManagement/GoogleServiceProvider.php 95.0% <100.0%> (+<0.1%) ⬆️
...ernal/DependencyManagement/RESTServiceProvider.php 100.0% <100.0%> (ø)
src/Options/TransientsAwareInterface.php 100.0% <100.0%> (ø)
src/Google/Ads/ServiceClientFactoryTrait.php 0.0% <0.0%> (ø)
src/Options/TransientsAwareTrait.php 33.3% <33.3%> (ø)
...ernal/DependencyManagement/CoreServiceProvider.php 0.0% <0.0%> (ø)
src/API/Google/Query/AdsCountryQuery.php 0.0% <0.0%> (ø)
src/API/Google/BudgetRecommendations.php 0.0% <0.0%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: tweak Small change, that isn't actually very important.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant