Get Sitelinks

312 views
Skip to first unread message

cv

unread,
Sep 7, 2022, 5:10:32 AM9/7/22
to Google Ads API and AdWords API Forum
Hi,

I need to get All Sitelinks in the account(Account, campaign or adgroup level).
I have gone through some of the post in this forum, and found there is multiple way to get sitelinks.

Some post says need to use 
For the reports that will give you Sitelinks, you can use asset_field_type_view  for migrated extensions and extension_feed_item for non migrated extensions.

Some says
However, if you want to get a sitelink related report for the sitelinks at different levels, then you can use the feed_placeholder_view and filter the feed_placeholder_view.placeholder_type by 'SITELINK'. 

I can also see some suggestion are also based on campaign_asset and ad_group_asset.

So which are the correct way?
Can you please explain how I can get?
 

Thanks,

cv

unread,
Sep 7, 2022, 7:45:52 AM9/7/22
to Google Ads API and AdWords API Forum
Hi,

In Addition to this how I can identify I need to use migrated extensions or non migrated extensions?

Thanks,

Google Ads API Forum Advisor

unread,
Sep 7, 2022, 7:52:08 AM9/7/22
to chirag....@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to us.

For our team to further check and provide an appropriate recommendation to your concern, could you provide to us the whole Google Ads UI screenshots where you can see the sitelinks you want to retrieve?

You may then send the requested information via the Reply privately to author option. If this option is not available, you may send the details directly to our googleadsa...@google.com alias instead.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dwCSw:ref

Zweitze

unread,
Sep 12, 2022, 8:07:35 AM9/12/22
to Google Ads API and AdWords API Forum
Let you give my experience.

In Addition to this how I can identify I need to use migrated extensions or non migrated extensions?

This is not using one API or the other. Within the same account both migrated and non-migrated extensions may exist. If you look careful in the UI of an account with non-migrated extensions, you will notice that you can migrate these extensions OR SOME OF THEM.
Some articles on this subject mentioned that all sitelinks would be forcefully migrated last year October, then that date was postponed to March. However, a few weeks ago I ran into an account which still had unmigrated sitelinks.

If the deadline of your project is still some months away, you are probably better off telling your boss or customers that your project will only work with migrated extensions, and use the API for asset-based sitelinks. One reason could be that you can no longer create unmigrated sitelinks, making testing extremely hard. Another reason is that the API for feed-based sitelinks is very hard.
If you can't get away with that, there's another nasty angle: Actually it's not the sitelinks that are migrated, but the campaigns or ad groups attached to sitelinks. Look again in the UI of unmigrated sitelinks: you can only upgrade groups and campaigns. On top of that, the API documentation does not state what happens to a feedbased sitelink once it is migrated, for instance what status it will get.

The algorithm I use is:
First get all asset-based sitelinks, and get the campaigns and ad groups attached to them. Get each and everyone, including the disabled and removed links. Then go on for the feed-based sitelinks, and get the campaigns and ad groups they are attached too, EXCEPT the campaigns and ad groups that are or were used for asset-based sitelinks - because these are migrated.

I hope this makes sense and helps you to get started.

cv

unread,
Sep 12, 2022, 8:50:14 AM9/12/22
to Google Ads API and AdWords API Forum
Hi Zweitze,

Thanks for sharing your experience.
This is really a wonderful explanation. 

The algorithm I use is:
First get all asset-based sitelinks, and get the campaigns and ad groups attached to them. Get each and everyone, including the disabled and removed links. Then go on for the feed-based sitelinks, and get the campaigns and ad groups they are attached too, EXCEPT the campaigns and ad groups that are or were used for asset-based sitelinks - because these are migrated.
--> This is the right algorithm to minimise any error. I think this applies to all extensions which are not migrated yet.

One above also has confusion that they have not migrated or planned for some extensions, so If I need to check all extensions then also this will work. 


Thanks,



Zweitze

unread,
Sep 12, 2022, 10:21:19 AM9/12/22
to Google Ads API and AdWords API Forum
About other ad extensions: I handle price extensions the same way, but beware: price extensions can also be attached to the account. You should understand how to handle those, just don't forget.

If you have findings contradicting my explanation, please share your findings!

Google Ads API Forum Advisor

unread,
Sep 12, 2022, 10:41:22 AM9/12/22
to chirag....@gmail.com, adwor...@googlegroups.com
Hi Chirag and Zweitze,

I want to add to the battle tested advice below that we have a Auto-migrated accounts detection guide, as soon as you detect auto migrated feeds you will know that they won't continue to serve. For manual migration of extension links to ad groups and campaigns etc.. this won't work and we suggest you Remove the Feed-based extension entirely in one shot.

It's recommended that you replace entirely an extension with all its links in one shot using Associate the asset with campaigns and ad groups, the sample code on the page shows all the campaign extension links being found, but if you look further in that sample it also gets all ad group links too. You can easily add for customer linked extensions. I can guess the reason for this advice is to easily and clearly keep track which extension feed items aren't serving anymore, while all others are still serving.

It is possible that one or more ad groups were manually migrated from a specific extension feed item while others weren't, especially if experiments were done and/or haphazard upgrades occured and that could make things harder to track. You can modify the Associate the asset with campaigns and ad groups to just show all active links to the extension feed items you are investigating.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dwCSw:ref

Zweitze

unread,
Sep 13, 2022, 8:26:02 AM9/13/22
to Google Ads API and AdWords API Forum
Hi Aryeh,

Thanks for mentioning the auto-migrated ad extensions, and how to detect them. Indeed my code always uses a lot of API requests to obtain legacy ad extensions (get feed mappings, get feed items, get associations with groups, campaigns, and account if we're not talking about sitelinks) even on accounts that were automigrated. Your suggestion could reduce that number of API requests. But... I'm not really sure. This detection guide assumes I already have a feed and feed item, and suggests to modify an item. But in my case, I don't know any item, or what a relevant mapping could be. So I need API requests to obtain feeds, feed mappings, feed items, and one API request to modify a feed item.
Which comes down to four API requests, exactly the same number of API requests I'm using now for sitelinks.

Can you elaborate? Also, will this work when the logged in user only has Read-only access to the account?


You may realize that my code - and probably Chirag's - is not about migrating ad extensions. We just want to retrieve all ad extensions, legacy or migrated.

cv

unread,
Sep 13, 2022, 8:56:12 AM9/13/22
to Google Ads API and AdWords API Forum
Hi,

Perhaps Aryeh try to elaborate we need to make one API call with each extensions with validate_only , So It will return error and with error handling we might detect it was migrated or not.

Yes exactly as said by Zweitze.  We just want to retrieve all ad extensions, legacy or migrated. and It is not really true with auto-migrated ad extensions detection.


Thanks,

 

Google Ads API Forum Advisor

unread,
Sep 15, 2022, 8:53:50 AM9/15/22
to chirag....@gmail.com, adwor...@googlegroups.com
Hello Chirag and Zweitze,

I smiled as soon as I saw both of your names because you both have always been problem solvers over the years. I really appreciate that!

@Zweitze Also, a big thank you for jumping in and helping out one of your fellow developers. You're amazing!

@Chirag So, let me dive into the questions that are left here. First, Zweitze is right. His way is the only way I know of to do what you're trying to accomplish. I double-checked with our experts on the team just to be sure. We've also passed on this forum thread to folks managing the migration so they can understand how complex this has become for all of you in order to try to improve the process in the future.

@Zweitze For any queries, that can be done with read-only. If you try to do a mutate (even if it's validate only), then it would be expected you would get back an error if you're read-only.

@Chirag Yes, you are correct that Aryeh was trying to emphasize the 'validate_only' part of making the request to check if migrated or not.

Thank you all for being such great problem solvers! I'm grateful for all this feedback, and I'm making sure it's making it to people who are leading this migration. 

Take care,
Google Logo
Nadine Wang
Google Ads API Team
 


ref:_00D1U1174p._5004Q2dwCSw:ref

Zweitze

unread,
Sep 19, 2022, 8:45:20 AM9/19/22
to Google Ads API and AdWords API Forum
@Nadine, thanks for validating my approach. I still wasn't sure I caught all scenario's!
@Chirag, I found out the web UI now support sitelinks on customer (account) level, be aware of that. That's only for new asset-based sitelinks. For legacy feed-based sitelinks this was never possible and you should not run into them.

cv

unread,
Sep 22, 2022, 12:50:48 PM9/22/22
to Google Ads API and AdWords API Forum
Hi,

@zweitze, Thanks for additional information. Yes, I will keep that in mind.
@Nadine, Thanks for the update.

Thanks,


Reply all
Reply to author
Forward
0 new messages