Final url contains illegal characters

1,222 views
Skip to first unread message

Yosi Bar Yosef

unread,
Feb 2, 2016, 10:57:07 AM2/2/16
to AdWords Scripts Forum
i got an exception while trying to generate an ad with hebrew parameter 
of course, i escaped the phrase prior the addon 

* here is the actual url (after escape the phrase 'בדיקה עברית' which means 'hebrew check')

* exception message: 
Final url contains illegal characters

* here is the souce code:
Logger.log('New Ad "%s"', keywordText);
var ad = CreateAd(adGroup, keywordText, 'Search for '.concat(keywordText ,'?'), 'all the best result are on website!', siteURL, siteURL.concat('?k=', escape(mostExpensiveKeywordText)));
if(!ad){
      Logger.log('some error occured');
      return;
}
Logger.log('Ad created successfully');


function CreateAd(adGroup, header, line1, line2, displayURL, destinationURL){ 
  Logger.log('url: %s', destinationURL);
  
  var operation = adGroup.newTextAdBuilder()
    .withHeadline(header) // 25 characters
    .withDescription1(line1) // 35 characters
    .withDescription2(line2) // 35 characters
    .withDisplayUrl(displayURL) // 255 characters
    .withFinalUrl(destinationURL) // 255 characters
    .build();
    
  if(!operation.isSuccessful())
    return null;
  return operation.getResult();
}

* here is my log:
New Ad "בדיקה עברית"
url: http://rcb.co.il?k=%u05D1%u05D3%u05D9%u05E7%u05D4%20%u05E2%u05D1%u05E8%u05D9%u05EA
some error occured

thanks (-: 

Tyler Sidell (AdWords Scripts Team)

unread,
Feb 2, 2016, 11:52:35 AM2/2/16
to AdWords Scripts Forum
Hi Yosi,

Would you be able to provide your CID (reply privately to the author), along with the name of your script so that we can take a look further into your issue?

Thanks,
Tyler Sidell
AdWords Scripts Team

Yosi Bar Yosef

unread,
Feb 2, 2016, 1:24:06 PM2/2/16
to AdWords Scripts Forum
the manager id is 365-531-7777
the account which the script are planted in is 269-153-4479
the script name is (R) Campaign Most-Expensive-Keyword Creator (STEP 2)

thanks

Yosi Bar Yosef

unread,
Feb 3, 2016, 7:49:12 AM2/3/16
to AdWords Scripts Forum
BTW: working great with english words but not with hebrew 

thanks

On Tuesday, February 2, 2016 at 6:52:35 PM UTC+2, Tyler Sidell (AdWords Scripts Team) wrote:

Yosi Bar Yosef

unread,
Feb 4, 2016, 12:53:54 PM2/4/16
to AdWords Scripts Forum
does anyone have a solution for this ? 

thanks

Anash Oommen

unread,
Feb 4, 2016, 3:39:40 PM2/4/16
to AdWords Scripts Forum
Hi Yosi,

The url seems encoded incorrectly, the AdWords UI also disallows the URL http://www.rcb.co.il/?k=%u05D1%u05D3%u05D9%u05E7%u05D4%20%u05E2%u05D1%u05E8%u05D9%u05EA. Could you kindly post this on the product forum? Someone might be able to take a look and give a suggestion on how best to fix the URL.

Cheers,
Anash P. Oommen,
AdWords Scripts Team.

Yosi Bar Yosef

unread,
Feb 5, 2016, 3:02:44 AM2/5/16
to AdWords Scripts Forum
i think i found the issue.. 
just need to remove the escape clause 

escape('בדיקה') 

when its off - the url is valid 
http://rcb.co.il/בדיקה

thanks


On Tuesday, February 2, 2016 at 5:57:07 PM UTC+2, Yosi Bar Yosef wrote:

Sanvika Thalla

unread,
Apr 26, 2017, 4:21:47 AM4/26/17
to AdWords Scripts Forum
Hello, 
this is sanvi.
I am creating the new ad, i got this message "illegal characters in the string ". What is this meaning? .How can i solve my problem?

Anthony Madrigal

unread,
Apr 26, 2017, 11:00:02 AM4/26/17
to AdWords Scripts Forum
Hi Sanvi,

Since this is an old post, could you please create a new thread with your issue? Please also include the details of your ad.

Regards,
Anthony
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages