Universal app campaign not working

259 views
Skip to first unread message

Imran Khan

unread,
Aug 7, 2019, 8:59:43 AM8/7/19
to AdWords API and Google Ads API Forum
I'm trying to create a mobile app campaign via google adwords api , version 201809,I'm following this sample of code written in python. 



But unfortunately it gives me an error which i have mentioned below.

[OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE @ operations[0].operand.settings]





Google Ads API Forum Advisor Prod

unread,
Aug 8, 2019, 2:31:33 AM8/8/19
to adwor...@googlegroups.com

Hi Imran,

OperationAccessDenied.OPERATION_NOT_PERMITTED_FOR_CAMPAIGN_TYPE error usually occurs when the operation is not permitted on the campaign type. Since you are trying to create a mobile app campaign, you may refer to this blog post and you may need to update your code based on the changes discussed in the blog.

If the issue still persists after updating your code, so I can further investigate the issue, could you provide the complete SOAP request and response logs via Reply privately to author? If you haven't enabled logging, you may enable the SOAP logging by referring to this guide.

Regards,
Hiroyuki
Google Ads API Team



ref:_00D1U1174p._5001UEIDGf:ref

Imran Khan

unread,
Aug 8, 2019, 4:10:09 AM8/8/19
to AdWords API and Google Ads API Forum
Yes i've figured out that this was the issue but we need an example which could illustrate how to do that. Can you please provide any sample code ? 

Google Ads API Forum Advisor Prod

unread,
Aug 8, 2019, 5:58:37 AM8/8/19
to adwor...@googlegroups.com

Hi Imran,

Unfortunately, we don't have the exact sample code that you are looking for. You may specify the UniversalAppCampaignInfo in your API call instead of UniversalAppCampaignSetting.

If you are encountering any issues while you update your code, I would suggest that you reach out to the owners of the client library as they are more equipped to answer to your questions.



Regards,
Hiroyuki
Google Ads API Team



ref:_00D1U1174p._5001UEIDGf:ref

Imran Khan

unread,
Aug 8, 2019, 6:26:33 AM8/8/19
to AdWords API and Google Ads API Forum
Actually i have changed the field names as per told but still i'm not able to create a campaign, and I don't know the proper format for how to make an AD inside of that. My code and the error which i am facing is down below.


ERROR
googleads.errors.GoogleAdsServerFault: Unmarshalling Error: cvc-elt.4.3: Type 'ns0:UniversalAppCampaignInfo' is not validly derived from the type definition, 'Setting', of element 'ns0:settings'.

CODE

campaign_service = client.GetService('CampaignService', version='v201809')

    budget_id = CreateBudget(client)

    # Create the Universal App campaign.
    universal_app_campaign = {
        'name': 'Cruise App #%s' % uuid.uuid4(),
        'status': 'PAUSED',
        'advertisingChannelType': 'MULTI_CHANNEL',
        'advertisingChannelSubType': 'UNIVERSAL_APP_CAMPAIGN',
        # Set the campaign's bidding strategy. Universal app campaigns only
        # support TARGET_CPA bidding strategy.
        'biddingStrategyConfiguration': {
            # Set the target CPA to $1 / app install.
            'biddingScheme': {
                'xsi_type': 'TargetCpaBiddingScheme',
                'targetCpa': {
                    'microAmount': '1000000'
                }
            },
            'biddingStrategyType': 'TARGET_CPA'
        },
        # Note that only the budgetId is required
        'budget': {
            'budgetId': budget_id
        },
        # Optional fields
        'startDate': (datetime.datetime.now() +
                      datetime.timedelta(1)).strftime('%Y%m%d'),
        'endDate': (datetime.datetime.now() +
                    datetime.timedelta(365)).strftime('%Y%m%d'),
    }

    universal_app_campaign['settings'] = [
        # Set the campaign's assets and ad text ideas. These values will
        # be used to generate ads.
        {
            'xsi_type': 'UniversalAppCampaignInfo',
            'appId': 'com.app'
            'appVendor': 'VENDOR_GOOGLE_MARKET',
        }
    ]


    # Construct operations and add campaigns.
    operations = [{
        'operator': 'ADD',
        'operand': universal_app_campaign
    }]

    campaigns = campaign_service.mutate(operations)['value']

Google Ads API Forum Advisor Prod

unread,
Aug 9, 2019, 1:49:01 AM8/9/19
to adwor...@googlegroups.com

Hi Imran,

Thank you for providing the further details.

You may refer to this guide for more details about the UniversalAppCampaignInfo type and try to implement similar code below:

UniversalAppCampaignInfo appCampaignInfo = new UniversalAppCampaignInfo();
appCampaignInfo.biddingStrategyGoalType(INSERT_TYPE_HERE);
appCampaignInfo.setAppId(INSERT_ID_HERE);
appCampaignInfo.setAppVendor(INSERT_VENDOR_HERE);

Campaign campaign = new Campaign();
campaign.setName("INSERT_CAMPAIGN_NAME_HERE");
campaign.setStatus(CampaignStatus.PAUSED);
campaign.setUniversalAppCampaignInfo(appCampaignInfo);


Please let me know if you have further clarifications.



Regards,
Hiroyuki
Google Ads API Team



ref:_00D1U1174p._5001UEIDGf:ref

Imran Khan

unread,
Aug 13, 2019, 2:39:33 PM8/13/19
to AdWords API and Google Ads API Forum
I've understood it and doing it the way I think it should be.  But there is still error,  can you please see my code again which I had mentioned in the last reply, and tell me what am i doing wrong? 
Thank you.

Google Ads API Forum Advisor Prod

unread,
Aug 14, 2019, 11:24:52 PM8/14/19
to adwor...@googlegroups.com
Hi Imran,

My apologies as I sent the reply privately.

Thanks for your reply. I am a colleague of Hiroyuki and I will provide answer to your support.

I noticed in this link that you already posted your issue on the support channel of Python client library. With this, I would recommend that you wait for the response of the client library owners as they should be able to provide better guidance on how you can properly implement your code for creating your UACs using the AdWords API.

Regards,
Ejay
Google Ads API Team

ref:_00D1U1174p._5001UEIDGf:ref
Reply all
Reply to author
Forward
0 new messages