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

Analytics::ANALYTICS_METRIC_GROUPS_WEB_CONVERSIONS should be ::ANALYTICS_METRIC_GROUPS_WEB_CONVERSION #21

Closed
bllevy opened this issue Sep 12, 2016 · 2 comments
Labels

Comments

@bllevy
Copy link

bllevy commented Sep 12, 2016

Hi hborras,

First off, thank you for all your hard work and development of this repo! It's much appreciated!

While working on an analytics related project, I recently noticed that the segment enumeration value for WEB_CONVERSION in the file /src/TwitterAds/Analytics.php is improperly mapped to "WEB_CONVERSIONS".

When attempting to make a request with

$metrics = [Analytics::ANALYTICS_METRIC_GROUPS_WEB_CONVERSIONS];

I receive this error message:

Fatal error: Uncaught exception 'Hborras\TwitterAdsSDK\TwitterAds\Errors\BadRequest' with message 'BAD_REQUEST' in /Users/bllevy/dev-stage/marketing-etl/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php:426
Stack trace:
#0 /Users/bllevy/dev-stage/marketing-etl/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php(408): Hborras\TwitterAdsSDK\TwitterAds->manageErrors(Object(stdClass))
#1 /Users/bllevy/dev-stage/marketing-etl/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php(221): Hborras\TwitterAdsSDK\TwitterAds->http('GET', 'https://ads-api...', 'stats/accounts/...', Array)
#2 /Users/bllevy/dev-stage/marketing-etl/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds/Analytics.php(60): Hborras\TwitterAdsSDK\TwitterAds->get('stats/accounts/...', Array)
#3 /Users/bllevy/dev-stage/marketing-etl/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds/Analytics.php(31): Hborras\TwitterAdsSDK\TwitterAds\Analytics::all_stats(Object(Hborras\TwitterAdsSDK\TwitterAds\Account), Array, Array, Array)
#4 /Users/bllevy/dev-stage/marketing- in /Users/bllevy/dev-stage/marketing-etl/vendor/hborras/twitter-php-ads-sdk/src/TwitterAds.php on line 426

I believe the fix would be as easy as updating:

const ANALYTICS_METRIC_GROUPS_WEB_CONVERSIONS                   = "WEB_CONVERSIONS";

to

const ANALYTICS_METRIC_GROUPS_WEB_CONVERSION                   = "WEB_CONVERSION";
@hborras
Copy link
Owner

hborras commented Sep 12, 2016

Really well explained, I'll take a look and I'll fix it

Thanks!!!!

@hborras hborras added the bug label Sep 13, 2016
@hborras
Copy link
Owner

hborras commented Sep 13, 2016

Solved in 730b21f

Thanks!

@hborras hborras closed this as completed Sep 13, 2016
@ghost ghost mentioned this issue Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants