- Clearly state the issue: "The CampaignConversionGoalOperation class in 
   version V18 of the google-ads-php library is missing the setCreate() 
   method, which is expected for creating campaign conversion goals. This 
   contradicts the general understanding and expected behaviour based on other 
   Google Ads API services."
   
   - I'm also attaching a file "CampaignConversionGoalOperation.php" V18.
   
   - Relevant Information:
   
   

   - Library version: google-ads-php-lib V18


   - PHP version: 8.3


   - Laravel version 10.23

 

   - Provide the relevant code snippet:
   $conversionGoal = new CampaignConversionGoal([
   'campaign' => $campaignResourceName,
   'category' => $categoryValue,
   'origin' => $originValue,
   'biddable' => false,
   ]);
   $operation = new CampaignConversionGoalOperation();
   $operation->setCreate($conversionGoal); 
   $mutateRequest = new MutateCampaignConversionGoalsRequest([
   'customer_id' => $customerId,
   'operations' => $operations,
   ]);
   
   $campaignConversionGoalServiceClient = $googleAdsClient->
   getCampaignConversionGoalServiceClient();
   $response = $campaignConversionGoalServiceClient->
   mutateCampaignConversionGoals($mutateRequest); 
   - 
   [2025-02-26 08:49:37] local.INFO: [image: 🔍] Processing Conversion 
   Goals: [{"category": "ENGAGEMENT", "origin": "GOOGLE_HOSTED", "biddable": 
   false}] 
   
   [2025-02-26 08:49:37] local.ERROR: [image: 🔴] Error creating conversion 
   goal for ENGAGEMENT: Call to undefined method 
   
Google\Ads\GoogleAds\V18\Services\CampaignConversionGoalOperation::setCreate()  
   
   [2025-02-26 08:49:37] local.WARNING: [image: ⚠️] No valid Conversion 
   Goal operations were created for the campaign: 
   customers/9529713466/campaigns/22286718458
   

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/cc6d956a-b29d-4d9c-868c-cdbc30cfeb12n%40googlegroups.com.
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v18/services/campaign_conversion_goal_service.proto

namespace Google\Ads\GoogleAds\V18\Services;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * A single operation (update) on a campaign conversion goal.
 *
 * Generated from protobuf message <code>google.ads.googleads.v18.services.CampaignConversionGoalOperation</code>
 */
class CampaignConversionGoalOperation extends \Google\Protobuf\Internal\Message
{
    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     */
    protected $update_mask = null;
    protected $operation;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           FieldMask that determines which resource fields are modified in an update.
     *     @type \Google\Ads\GoogleAds\V18\Resources\CampaignConversionGoal $update
     *           Update operation: The customer conversion goal is expected to have a
     *           valid resource name.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V18\Services\CampaignConversionGoalService::initOnce();
        parent::__construct($data);
    }

    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * FieldMask that determines which resource fields are modified in an update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

    /**
     * Update operation: The customer conversion goal is expected to have a
     * valid resource name.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v18.resources.CampaignConversionGoal update = 1;</code>
     * @return \Google\Ads\GoogleAds\V18\Resources\CampaignConversionGoal|null
     */
    public function getUpdate()
    {
        return $this->readOneof(1);
    }

    public function hasUpdate()
    {
        return $this->hasOneof(1);
    }

    /**
     * Update operation: The customer conversion goal is expected to have a
     * valid resource name.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v18.resources.CampaignConversionGoal update = 1;</code>
     * @param \Google\Ads\GoogleAds\V18\Resources\CampaignConversionGoal $var
     * @return $this
     */
    public function setUpdate($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V18\Resources\CampaignConversionGoal::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getOperation()
    {
        return $this->whichOneof("operation");
    }

}

  • Ca... dhrutish ramoliya
    • ... dhrutish ramoliya
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to