Getting all sitelinks from my MCC

173 views
Skip to first unread message

murali.p...@gmail.com

unread,
Jul 31, 2014, 8:12:46 AM7/31/14
to adwor...@googlegroups.com

Hi

I have a MCC account

I want to get all accounts , campaigns, adgroups , ads , keywords and sitelinks under my MCC accounts

I am able to get all other than sitelinks.

Which service can I use to get sitelinks and how to do it with PHP client library ?

Thank you in Advance

Murali

Josh Radcliff (AdWords API Team)

unread,
Aug 1, 2014, 4:15:59 PM8/1/14
to adwor...@googlegroups.com
Hi Murali,

Sitelinks (as well as some other extension types) are implemented using feed services.

The most straightforward way to find the sitelinks for an account is to run the PLACEHOLDER_FEED_ITEM_REPORT and set includeZeroImpressions to true. The DownloadCriteriaReport.php code sample shows how to run a report using the API. You can use that as a starting point and change it to run the PLACEHOLDER_FEED_ITEM_REPORT.

Cheers,
Josh, AdWords API Team

Josh Radcliff (AdWords API Team)

unread,
Aug 1, 2014, 4:17:04 PM8/1/14
to adwor...@googlegroups.com
Hi,

One quick note - you will have to run the report for each AdWords account individually. You cannot run the PLACEHOLDER_FEED_ITEM_REPORT for all accounts under an MCC in a single request.

Thanks,
Josh, AdWords API Team

murali.p...@gmail.com

unread,
Aug 14, 2014, 2:58:23 AM8/14/14
to adwor...@googlegroups.com
Hi Anash,


Thank you for the reply and it was very helpful.

Murali

Mark

unread,
Jan 20, 2016, 2:34:02 PM1/20/16
to AdWords API Forum
Hello Josh,

I have run the PLACEHOLDER_FEED_ITEM_REPORT, but where I can get Sitelink Urls?
Should I look for the AttributeValues for the Site link Urls?

Should I assume the JSON response for AttributeValues always be in this order Link TextFinal URLsLine 1, and Line 2?

Thanks,

Josh Radcliff (AdWords API Team)

unread,
Jan 20, 2016, 6:18:19 PM1/20/16
to AdWords API Forum
Hi,

Rather than assume that the feed attribute IDs in the JSON response will always be the same, it's best to look up the mapping of placeholder field ID to attribute ID in the corresponding FeedMapping. There's no guarantee, for example, that ID 1 in the JSON response will always be the link text.

Thanks,
Josh, AdWords API Team

Mark

unread,
Jan 21, 2016, 1:00:30 PM1/21/16
to AdWords API Forum
Hello Josh,

Thanks for the information.
So placeholder field ID = 1 always be sitelinks. And by looking at respective Attribute values under feed item report I can get sitelink urls.

I'm following correct path here?

Thank,

Josh Radcliff (AdWords API Team)

unread,
Jan 21, 2016, 4:35:58 PM1/21/16
to AdWords API Forum
Hi,

The placeholder type will always be 1 for sitelinks, but the attribute IDs you get back in the JSON may vary by feed. There are two phases to setting up a feed:

1. Create the Feed and specify the list of attributes. The order of these attributes can be any order you choose, so you could, for example, choose to make the LINE 1 attribute attribute ID 1 (the first attribute), the TEXT attribute attribute ID 2 (the second attribute), and so on.

2. Create a FeedMapping, which tells AdWords:
  a) For which placeholderType (e.g., extension type such as 1 for sitelinks) you want AdWords to use the feed.
  b) How each attribute maps to the predefined list of placeholder field IDs for the placeholderType.

Using the example above with the following attributes:
- LINE 1 : attribute ID = 1
- TEXT : attribute ID = 2
You would create the following AttributeFieldMappings on your FeedMapping:
- feedAttributeId = 1, fieldId = 3 (because LINE 1 corresponds to placeholder field ID 3)
- feedAttributeId = 2, fieldId = 1 (because TEXT corresponds to placeholder field ID 1)

Therefore, when running the PLACEHOLDER_FEED_ITEM_REPORT, the returned JSON objects, which have the feedAttributeId, would come back with:
  "1": the value for LINE 1
  "2": the value for TEXT

In other words, you need to look at the FeedMapping for the feed and placeholder type if you want to tie the JSON IDs back to placeholder fields.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages