I am implementing adword api version 201306 in one of my project. I am able to fetch the details of a campaign but unable to retrieve the budget details.
My goal is to access the budget details and modify them. I am using PHP library and request to all of you a piece of code written in php.
Any help would be highly appreciated.
Thanks,
Pramod
I found the solution and here is the way you need to go out - -
First you need to pass out the field 'BudgetId' in Campaign Service selector for CampaignStats.
Now you can use following code - -
$budgetService = $user->GetService('BudgetService', ADWORDS_VERSION);
$bm = new Money('10000000');
$campaign->budget->amount = $bm;
$boperation = new BudgetOperation();
$boperation->operand = $campaign->budget;
$boperation->operator = 'SET';
$budgetService->mutate($boperation);
Yes, I agree that this help is very less. Do let me know if anyone face any issue OR need more help.
Regards,
Pramod
Related
I'm using Podio API PHP to try to update some tasks, I'm using the method PodioTask::get($task_id); as the documentation says, but is not working, I'm receiving the following error message:
The user with id 4654583 does not have the right view on task with id
355
This is the code
$task_id = 355;
$items = PodioTask::get($task_id);
dump_var($items);
Does anybody has the same issue?
In advance, thank you for your help
I am using jonasva's laravel facebook insights package ( https://github.com/jonasva/laravel-facebook-insights).
And stuck at the very beginning. So if someone is familiar and can help me out.
I have setup the facebook-insights.php with all the information that is needed. (AppID, Secret, ermanent access token ...)
However, when I try to get the PageTotalImpressions I receive the number 0
FacebookInsightsController:
//Get Facebook PageImpressions
public function getPageImpressions() {
$startDate = new \DateTime('2017-01-01');
$endDate = new \DateTime('2017-03-26');
// fetch your page's total impressions for a given period
$totalImpressions = FacebookInsights::getPageTotalImpressions($startDate, $endDate);
return $totalImpressions;
}
I know that there are Impressions, as Facebook Insights shows different numbers.
Any idea what's wrong here ?
thanks
I just tried using this package myself, I stopped and removed it before even delving in.
On the composer install it states that it loaded php-sdk-v4 which has been abandoned jonasva's laravel facebook insights package has not been updated for over 2 years.
I recommend you do the same as me and begin searching for a new package.
I would like to create a campaign using Facebook API. I tried to run all available example without success.
First of all I created an App in order to have a APP_ID and a APP_SECRET.
I did all the procedure to add my Ad_account following the tutorial.
I downloaded all the SDK to facilitate Facebook API use like:
facebook-php-ads-sdk and run adgroup_creation.php and curl_log.php with my data, without success.
facebook-php-sdk-v4 I suppose it is less specific than the previous one.
Multi-Product Ads with the Facebook Marketing POST -> developers.facebook.com/ads/blog/post/2015/03/26/creating-multi-product-ads/
the developers reference -> developers.facebook.com/docs/reference/php/4.0.0
I used "Composer" to get all dependency.
In all this case I had problem to create a campaign using more or less this code:
$campaign = new \FacebookAds\Object\AdCampaign(null,"act_$ACCOUNT_ID");
$campaign->setData(array(
AdCampaignFields::NAME => 'My First Campaign',
AdCampaignFields::OBJECTIVE => AdObjectives::WEBSITE_CLICKS,
AdCampaignFields::STATUS => AdCampaign::STATUS_PAUSED ));
// PROBLEM is Here
$campaign->create();
Any help? How can I get a more useful error?
It's difficult to help without knowing the exact error. However, you could try this: before creating your campaign, initialize the API using:
Api::init(<your_app_id>, <your_ap_secret>, <your_token>);
(You need to load FacebookAds\Api to use this function).
I'm using the SalesForce PHP Toolkit and getting a connection just fine. But when I use any of the example code - see here
INVALID_FIELD: No such column '' on entity 'Contact'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
I might just be struggling to find the answer because Google won't let me search for ''
The environment is CentOS 6 with PHP 5.3.
I just created an account here to answer this question. It took me all day long to find out this bug in PHP Toolkit. The problem is caused by the "fieldsToNull" property. I read an approx. solution here that gave me an idea where to look for the solution.
So a correct example would be:
$fields = array('LastName' => 'Doe');
$sObject = new SObject();
$sObject->fields = $fields;
$sObject->fieldsToNull = NULL;//this is the solution! :)
$sObject->type = 'Contact';
Then, proceed as usual with the remaining part of the examples of the PHP Toolkit. It worked fine with my Partner WSDL+Developer SF Account.
Hope it helps!
I can perfectly add an event with Google Calendar API V3 as described in https://developers.google.com/google-apps/calendar/recurringevents but I can't figure how to start on the update event process.
I guess I have to select the event (I do have the event ID stored on my DB) and then set the parameters and call an update event. But don't know where to start...
There seems to be very few tutorials around. Any ideas please?
Ok I finally got the answer my self. Struggled to read on those Google API Explorer and matching them against the google-api-php-client. Anyway, here it is a simple code to update the description, summary and event color.
$apiClient = new apiClient();
$apiClient->setUseObjects(true);
$service = new apiCalendarService($apiClient);
$events = $service->events;
$currEvent = $events->get("primary", $event_id);
$currEvent->setDescription("YOUR FULL DESCRIPTION");
$currEvent->setSummary("YOUR DESIRED SUMMARY - Kind of title");
$currEvent->setColorId(2); // One of the available colors ID
$recurringEvent = $events->update('primary', $event_id, $currEvent);
Remember that this code needs to be ran only after authentication.
Hope it helps someone. It did me ;)