AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

2.3K members online now
2.3K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me

Script Issue - Inventory-based Ad Management

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭



I've been struggling to customize Google's Inventory-Based Ad Management script. I think it does some great things, but I'm not able to add new columns...


That is the script I'm using, and once I try to add a new dynamic field (column to the spreadsheet), the script says:

  "The attribute you are trying to use (specs) does not exist."


I have followed the steps from the "Add new dynamic fields" guidelines from the script documents, but to no avail. Has anyone had any luck with this? Maybe I'm missing something.


1. I delete ad customizer Ad from my AdWords UI (with label Discounts)

2. I update createAdCustomizerSource method with "specs"


function createAdCustomizerSource() {
Logger.log('Creating a new ad customizer source for discounts...');

if (AdWordsApp.getExecutionInfo().isPreview()) {
Logger.log('This step won\'t work with preview mode, and your script may ' +
'fail at a later stage. Try running this script normally.');

var source = AdWordsApp.newAdCustomizerSourceBuilder()
.addAttribute('code', 'text')
.addAttribute('coupon', 'text')
.addAttribute('discount', 'number')
.addAttribute('name', 'text')
.addAttribute('specs', 'text')



return source;


3. I update the updateAdCustomizerItems method as well:


function updateAdCustomizerItems(source, rules) {
Logger.log('Syncing the discount ad customizer source with the ' +
'spreadsheet data...');

var itemMap = {};

// Store the existing ad customizer items into a
// lookup map.
var items = source.items().get();
while (items.hasNext()) {
var item =;
var productCode = item.getAttributeValue('code');
itemMap[productCode] = item;

for (var i = 0; i < rules.length; i++) {
// For each rule, see if there's an existing customizer
// item by matching the item code.
var rule = rules[i];
var item = itemMap[rule.code];

if (!item) {
// This is a new item that was added to the spreadsheet.
// Create a new customizer item for this code.
item = source.adCustomizerItemBuilder()
.withAttributeValue('code', rule.code)
.withAttributeValue('specs', rule.specs)
} else {
// Update this customizer item with the latest details
// from the spreadsheet.



The script can run just fine, but as soon as I try to add the ad customizer for Specs into the expandedTextAdBuilder:

.withHeadlinePart1("New Kia {=Discount.specs}")


I get an error:

  "The attribute you are trying to use (specs) does not exist."


Has anyone else encountered this?




1 Expert replyverified_user

Script Issue - Inventory-based Ad Management

Community Manager
# 2
Community Manager

Hi Dmitri,


Thanks for reaching out to the AdWords Community. It looks like you have a question concerning the troubleshooting of an AdWords script. For technical discussions with developers and members of the AdWords scripts team, we'd recommend visiting the AdWords Scripts Forum.


Hope this helps!