There is any solution with limits of matchingFunction when i go over 20 items

38 views
Skip to first unread message

Abdelghani GUILIGHE

unread,
Aug 8, 2017, 5:11:12 AM8/8/17
to AdWords API Forum
Hi,

when I go over 20 feed items in the camaping Feed, I have this error : 


[CollectionSizeError.TOO_MANY @ operations[0].operand.matchingFunction.lhsOperand[0].value.rhsOperand] 

please how can I solve this, I'm working with PHP client library.

Here's the code :

($arrSiteLinkFeedItemsIds this array have over 20 items)
$matchingFunctionString = sprintf(
        'AND( IN(FEED_ITEM_ID, {%s}), EQUALS(CONTEXT.DEVICE, "Desktop") )',
        implode(',', $arrSiteLinkFeedItemsIds)
  );

    // Create a campaign feed and its feed function.
    $campaignFeed = new CampaignFeed();
    $campaignFeed->setFeedId($sitelinksData['sitelinksFeedId']);
    $campaignFeed->setCampaignId($campaignId);

    $matchingFunction = new MatchingFunction();
    $matchingFunction->setFunctionString($matchingFunctionString);
    $campaignFeed->setMatchingFunction($matchingFunction);
    $campaignFeed->setPlaceholderTypes([self::PLACEHOLDER_SITELINKS]);

Best Regards,

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Aug 8, 2017, 11:31:19 AM8/8/17
to AdWords API Forum
Hi, 

The rhsOperand while using the IN operator has a limit of 20 ConstantOperands. Please check the documentation for reference. You will have to make sure that the number of feed item ids that you are setting is 20 or less than that. 

Thanks,
Sreelakshmi, AdWords API Team
Reply all
Reply to author
Forward
0 new messages