Suffix Url Empty

41 views
Skip to first unread message

asaad....@datorama.com

unread,
Apr 17, 2019, 2:28:51 AM4/17/19
to AdWords API and Google Ads API Forum
Hi ,
i'm using the google ads library v201806 , 
i'm trying to change the suffix url for creative the problem that when i'm getting the creatives i got empty url for ads , 
even with that they really have values .

i'm using this code to get the creatives  : 

 AdWordsSession adWordsSession =  googleAuthenticator.initSession(token,customerId,dsJsonConfig);
        AdWordsServicesInterface adWordsServices = AdWordsServices.getInstance();

        AdServiceInterface adService =
                adWordsServices.get(adWordsSession, AdServiceInterface.class);

        int offset = 0;


        String s = "";
// Create selector.
        SelectorBuilder builder = new SelectorBuilder();
        Selector selector = builder
                .fields(AdField.Id,AdField.Url)
                //.in(AdField.Id,s)
                .offset(offset)
                .limit(500)
                .build();

        AdPage page;
        do {
            // Get all campaigns.
            page = adService.get(selector);

            // Display campaigns.
            if (page.getEntries() != null) {
                for (Ad ads : page.getEntries()) {
                    System.out.printf("Campaign with name '%s' and ID %d was found.%n", ads.getDisplayUrl(),
                            ads.getId());
                }
            } else {
                System.out.println("No campaigns were found.");
            }

            offset += 500;
            selector = builder.increaseOffsetBy(500).build();
        } while (offset < page.getTotalNumEntries());




thanks in advance ,
Asaad.

googleadsapi...@google.com

unread,
Apr 17, 2019, 3:09:39 AM4/17/19
to adwor...@googlegroups.com
Hi Asaad,

Could you confirm if the url you are referring to is the finalUrlSuffix field? If yes, could you change your selector and use the AdField.CreativeFinalUrlSuffix instead of AdField.Url? Let me know if this helps.

Thanks and regards,
Peter
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/e8a29868-e979-4234-9d45-c785b02a4402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

asaad....@datorama.com

unread,
Apr 21, 2019, 1:53:13 AM4/21/19
to AdWords API and Google Ads API Forum
Hi Peter,
Thanks for you response , i've changed and now it looks good ,

another question that related to the development 




AdWordsSession adWordsSession =  googleAuthenticator.initSession(token,customerId,dsJsonConfig);

long adId = Long.parseLong(adId);
Ad ad = new Ad();
ad.setId(adId);
ad.setFinalUrlSuffix(suffixUrlNewValue);


AdOperation operation = new AdOperation();
operation.setOperand(ad);
operation.setOperator(Operator.SET);

AdOperation[] operations = new AdOperation[] { operation };


AdWordsServicesInterface adWordsServices = AdWordsServices.getInstance();
AdServiceInterface adService = adWordsServices.get(adWordsSession, AdServiceInterface.class);
AdReturnValue result = adService.mutate(operations);



and i got error :  
[AdError.INVALID_AD_TYPE @ operations[0].operand.id]

googleadsapi...@google.com

unread,
Apr 21, 2019, 11:48:27 PM4/21/19
to adwor...@googlegroups.com
Hi Asaad,

So I can better investigate the cause of the error, could you provide to me the complete SOAP request and response logs? If you haven't yet, you may enable SOAP logging on your end by referring to this guide.

Once enabled you may send your reply to me privately via the Reply privately to author option.

Thanks and regards,
Peter
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
Reply all
Reply to author
Forward
0 new messages