tmarois / laravel-ads-sdk

PHP SDK for Google Ads, Bing Ads, and Facebook Ads API for Laravel
MIT License
113 stars 46 forks source link

DestinationUrlPerformanceReport #1

Closed dominikraff closed 5 years ago

dominikraff commented 5 years ago

Is it also possible to geht DestinationUrlPerformanceReport? I tried this, but it doesn't work.

dominikraff commented 5 years ago

DestinationUrlPerformanceReportRequest {#646 ▼ +Aggregation: "Daily" +Columns: array:2 [▶] +Filter: null +Scope: DestinationUrlPerformanceReportScope {#645 ▶} +Time: ReportTime {#644 ▶} +ExcludeColumnHeaders: null +ExcludeReportFooter: null +ExcludeReportHeader: null +Format: "Csv" +Language: null +ReportName: "Destination URl Performance Report" +ReturnOnlyCompleteData: false }

Always this error occurs:

SoapFault Invalid client data. Check the SOAP fault details for more information COPY Application frames (9) All frames (78) 77 SoapFault …/vendor/grayscale/laravel-ads-sdk/src/Services/BingAds/Reports.php123

timothymarois commented 5 years ago

I'll take a look. https://docs.microsoft.com/en-us/bingads/reporting-service/destinationurlperformancereportrequest?view=bingads-12

What is your code you're using to call this service?

dominikraff commented 5 years ago

That's my code, its nearly the same like AdGroupReport

public function buildDestinationUrlReport() { $report = new DestinationUrlPerformanceReportRequest(); $report->ReportName = 'Destination URl Performance Report'; $report->Format = ReportFormat::Csv; $report->ReturnOnlyCompleteData = false; $report->Aggregation = ReportAggregation::Daily; $report->Scope = new DestinationUrlPerformanceReportScope(); $report->Scope->AccountIds = [$this->service->getClientId()]; $report->Time = new ReportTime(); $report->Time->CustomDateRangeStart = new Date(); $report->Time->CustomDateRangeStart->Day = date('d',strtotime($this->dateRange[0])); $report->Time->CustomDateRangeStart->Month = date('m',strtotime($this->dateRange[0])); $report->Time->CustomDateRangeStart->Year = date('Y',strtotime($this->dateRange[0])); $report->Time->CustomDateRangeEnd = new Date(); $report->Time->CustomDateRangeEnd->Day = date('d',strtotime($this->dateRange[1])); $report->Time->CustomDateRangeEnd->Month = date('m',strtotime($this->dateRange[1])); $report->Time->CustomDateRangeEnd->Year = date('Y',strtotime($this->dateRange[1])); $report->Columns = array ( AdGroupPerformanceReportColumn::TimePeriod, AdGroupPerformanceReportColumn::AccountId ); $encodedReport = new SoapVar($report, SOAP_ENC_OBJECT, 'DestinationUrlPerformanceReportRequest', $this->serviceProxy->GetNamespace()); $reportRequestId = $this->submitGenerateReport($encodedReport)->ReportRequestId; return (new ReportDownload($this->serviceProxy, $reportRequestId)); }

What i have made new ist the DestinationUrlPerformanceReportScope, because it wasn't there.

namespace Microsoft\BingAds\V12\Reporting; { final class DestinationUrlPerformanceReportScope { /**

  • The identifier of the account that the ad group belongs to.
  • @var integer */ public $AccountId; /**
  • The identifier of the campaign that the ad group belongs to.
  • @var integer */ public $CampaignId; /**
  • The identifier of the ad group to limit the scope to.
  • @var integer */ public $AdGroupId; } }
timothymarois commented 5 years ago

@dominikraff Looks like it was due to required fields. I was able to get it working using below:

https://docs.microsoft.com/en-us/bingads/reporting-service/destinationurlperformancereportcolumn?view=bingads-12#requiredcolumns

     $report->Columns = array (
                DestinationUrlPerformanceReportColumn::TimePeriod,
                DestinationUrlPerformanceReportColumn::AccountName,
                DestinationUrlPerformanceReportColumn::AccountId,
                DestinationUrlPerformanceReportColumn::CampaignName,
                DestinationUrlPerformanceReportColumn::Clicks,
                DestinationUrlPerformanceReportColumn::Impressions,
                DestinationUrlPerformanceReportColumn::Spend,
                DestinationUrlPerformanceReportColumn::Conversions,
                DestinationUrlPerformanceReportColumn::Revenue,
                DestinationUrlPerformanceReportColumn::DestinationUrl
            );

Also use, AccountThroughAdGroupReportScope instead of DestinationUrlPerformanceReportScope That is what they request in the SDK.

Note: in my test, I was not able to see destination url, it was blank for me, let me know if you get yours to show, unless its something with the account I was testing in.

If you find anything useful, I am open to collabration and pull request to improve this SDK.

dominikraff commented 5 years ago

Thanks!

If you use the field: DestinationUrlPerformanceReportColumn::FinalUrl you can see the url, so it does work!

timothymarois commented 5 years ago

Thanks!

If you use the field: DestinationUrlPerformanceReportColumn::FinalUrl you can see the url, so it does work!

Awesome. Thank you or that. I will have to try it on my project. Let me know if you find anything else useful we can include in this SDK and make it more seamless. Bing is a challenge to work with, that's why I originally built this to make it a lot easier to get data without the hassle of working with all the different sources.

dominikraff commented 5 years ago

Would be nice, if you implement it.

The ads-sdk for laravel is awesome. Yeah, bing is a challenge, Google is a challenge and facebook to. So it it's perfekt! :) 👍

timothymarois commented 5 years ago

@dominikraff Thanks! – I will implement this in the next update.

timothymarois commented 5 years ago

@dominikraff Checkout the recent release 1.2.9 added a bunch of new reports for bing/google. Including final url report.

dominikraff commented 5 years ago

He Timo,

if i try to install "googleads/googleads-php-lib": "^40.0.0“,

with composer, i always got this problem. Can you solve this?

Am 27.02.2019 um 04:32 schrieb Timothy Marois notifications@github.com:

@dominikraff https://github.com/dominikraff Checkout the recent release 1.2.9 added a bunch of new reports for bing/google. Including final url report :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Grayscale/laravel-ads-sdk/issues/1#issuecomment-467710440, or mute the thread https://github.com/notifications/unsubscribe-auth/AaAs4j0havVYkohPoS7w93upioxtmfAxks5vRfxYgaJpZM4bHt4Q.

timothymarois commented 5 years ago

Hello, @dominikraff I will look into this and get back to you. It looks like you're trying to use a newer version of the googleads api. I will run some tests to see if it's still compatible.

dominikraff commented 5 years ago

Yes i try to use a newer version, because 201806 doesn’t work any more on 4. April. So i would like to update this package, and it isn’t possible.

best regards

Am 27.03.2019 um 16:23 schrieb Timothy Marois notifications@github.com:

Hello, @dominikraff https://github.com/dominikraff I will look into this and get back to you. It looks like you're trying to use a newer version of the googleads api. I will run some tests to see if it's still compatible.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Grayscale/laravel-ads-sdk/issues/1#issuecomment-477206931, or mute the thread https://github.com/notifications/unsubscribe-auth/AaAs4nOqUUpqU7OXiqO2DhDcftCwP_afks5va4zigaJpZM4bHt4Q.

timothymarois commented 5 years ago

@dominikraff I have pushed a new release version 1.2.11 this includes the new google ads API version 40. Let me know if that solved your issue.

dominikraff commented 5 years ago

Looks like it works, the update works, thanks for your help in this case.

Best regards, Dominik

Am 29.03.2019 um 17:47 schrieb Timothy Marois notifications@github.com:

@dominikraff https://github.com/dominikraff I have pushed a new release version 1.2.11 this includes the new google ads API version 40. Let me know if that solved your issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Grayscale/laravel-ads-sdk/issues/1#issuecomment-478069403, or mute the thread https://github.com/notifications/unsubscribe-auth/AaAs4o8KsrhvbftPH0pXmpYfUt1ogg8oks5vbkOjgaJpZM4bHt4Q.