Frederick Vallaeys

Frederick Vallaeys was one of the first 500 employees at Google where he helped grow the AdWords search marketing system and served as Google’s AdWords Evangelist, teaching advertisers about which Google products are best to support their marketing goals. He was a key player on several of the teams that made AdWords into the leading platform for search marketing, including the team that started the AdWords Editor and the one that acquired Urchin (now Google Analytics). He has contributed his technical expertise to several AdWords books including bestsellers like “AdWords for Dummies,” “Advanced Google AdWords,” and “Quality Score in High Definition” and he writes a monthly blog for He helps advertisers improve their search marketing results through, an AdWords tool company that makes a Historical Quality Score Tracker, One-Click AdWords Optimizations and other tools to make account management more efficient.


  1. Tom
    August 4, 2016 @ 1:59 am

    Looks like a great script. Unfortunately I am getting this error when trying to run it –

    TypeError: Cannot read property “1” from null. (line 237)

    Has anyone got any ideas on how to fix? It looks like it happens when trying to pull information from the first landing page.


  2. Frederick Vallaeys
    August 5, 2016 @ 9:41 am

    Thanks for the feedback. I have added code to deal with meta tags that use different capitalization, e.g. , , or . Let us know if it still breaks….

  3. McKinsey Klint
    August 8, 2016 @ 9:55 am

    I am getting the same error as well “TypeError: cannot read property “1” from null. (line 243)

    Line 243 is:
    var title = scrap[1];

  4. Frederick Vallaeys
    August 8, 2016 @ 12:09 pm

    What is your landing page URL please? The script is not able to find a title tag so I’d like to take a look at how your html is set up.

  5. Liam Holmes
    August 17, 2016 @ 5:30 pm

    I just ran the script and the output looks good.

    Not just for converting to the new expanded ads- but also for creating new ads(expanded) for a new client- like an e-commerce company with lots of products…
    The script is taking out the copy from the website meta title and description tags-putting the clients copy into the draft ad versions of Google sheet/CSV that can be imported as is – after any amendments.
    Having the same spacing for titles and descriptions as the website meta tags and expanded ad copy- this is certainly very practical.

  6. Ian Harmon
    August 26, 2016 @ 7:45 am

    This looks like a really useful script Frederick, thanks for sharing. I’m seeing an error in preview though: ReferenceError: “checkUrls” is not defined. (line 133)

    i thought i’d followed the instructions, did I miss something? Thanks

  7. Rumenigo Fernandes
    August 30, 2016 @ 3:06 am

    I tried this script but I get this error ..
    ReferenceError: “checkUrls” is not defined. (line 133)

  8. Rumenigo Fernandes
    August 30, 2016 @ 3:07 am

    Hi Ian
    did you get the solution for this issue?

  9. Frederick Vallaeys
    August 30, 2016 @ 11:01 am

    Can you please try again now? Thanks for reporting the bug.

  10. Matthew Chan
    August 30, 2016 @ 10:16 pm

    I tried running the script and i get this Error…

    new url found: [“”]
    checking [“”]
    Exception: Invalid argument: [“”]

  11. Bob L
    September 22, 2016 @ 8:48 am


    Thanks fort the script.

    Also running into the issue that Matthew Chan is having with the “invalid argument”

    “Exception: Invalid argument:”

    Any suggestion of a path to follow to troubleshoot? The URL’s in question all resolve properly when manually tested.

  12. natalia
    September 29, 2016 @ 11:31 pm

    hi, great script but maybe you know why there is almost everything udefined in a sheet? (meta title, meta desc, first H1 (or h1, ive tried both) – undefined , just final URL, campaign and adgroup with content)

  13. Peter Konc
    October 15, 2016 @ 8:37 am

    Hi there, I have same issue. Do you solved it somehow? Thanks.

  14. natalia
    October 15, 2016 @ 1:10 pm

    nope, not yet :/ sorry

  15. lucy
    November 16, 2016 @ 12:02 pm

    Hi, could you please help? I am getting this error:
    Not authorized
    This script is currently not authorized to run in your account.
    Please start the authorization process again.

  16. Frederick Vallaeys
    November 30, 2016 @ 9:43 am

    Hi Lucy,

    Did you try to re-authorize as explained here:

    Let us know if that doesn’t work…


  17. lucy
    December 1, 2016 @ 5:58 pm

    Yeah, tried again but got the same error message:
    Not authorized
    This script is currently not authorized to run in your account.
    Please start the authorization process again.

  18. Tina Arnoldi
    March 16, 2017 @ 12:38 pm

    Not sure where I went wrong. I did edit the top section but received this error

    The coordinates or dimensions of the range are invalid. (line 175)

    Line 175 is
    metaSheet.getRange(2, 6, numRows, 1).setFormulaR1C1(“=LEN(R[0]C[-1])”);

Leave a Reply

Your email address will not be published. Required fields are marked *