Using reports to sync account structure

298 views
Skip to first unread message

Oliver

unread,
Jun 12, 2012, 3:10:27 PM6/12/12
to adwor...@googlegroups.com

Hi,

What is the best way to synchronize our local database record of the account structure with that from the API?

We can get the x_performance_report for each entity and compare the return result with what we have locally.  However, we believe the performance reports do NOT return all the entities (that don't have data) even when includeZeroImpressions is set to TRUE as confirmed by the following:

http://googleadsdeveloper.blogspot.co.uk/2011/12/zero-impression-data-in-adwords-api.html

"...but be aware that setting it to "true" does not guarantee that zero-impression rows will be returned.".

How else can one ensure we're getting back all the account entities irrespective of their performance data or statuses, etc.

Oliver




mm

unread,
Jun 13, 2012, 1:03:25 PM6/13/12
to adwor...@googlegroups.com
Oliver -
Use a predicate for Impressions >= 0; this seems to return all entities regardless of the value of the includeZeroImpressions flag.

HTH -
mm

Anash P. Oommen

unread,
Jun 14, 2012, 5:09:28 AM6/14/12
to adwor...@googlegroups.com
Hi Oliver,

See the report fields listed on https://developers.google.com/adwords/api/docs/appendix/reports. If you include certain fields in a report, it prevents zero impression rows from being returned even if you have set includeZeroImpressions as true. Such columns are explicitly documented on this page (e.g.  Date column in Campaign Performance Report). Check if your report definition includes any column that prevents zero impression rows from being returned.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Oliver

unread,
Jun 14, 2012, 12:55:57 PM6/14/12
to adwor...@googlegroups.com
mm, thanks for your help.

Anash, I went through all the reports types looking for the 'prevents zero impressions' note.  Here is my conclusion:

- The account structure is defined by fields that have "Behavior=Attribute" in the performance reports.  I don't care about other fields when updating the account structure.
- None of the 'Attribute' fields in any of the reports has a 'prevents zero impression' note (except for 2 fields, but these look very odd to me and I'm posting a separate question about them).

Hence, from the above, am I right in concluding that I can indeed get back the full account structure by specifying ONLY the 'Attribute' fields when requesting the reports?

Oliver

David Torres

unread,
Jun 19, 2012, 12:31:39 AM6/19/12
to adwor...@googlegroups.com
Hi Oliver,

Your assumptions are correct at the moment, so you can use "attribute" type of fields to obtain all structural data including zero impressions. But there is no guarantee that we won't introduce "attribute" fields that will prevent zero impressions in the future.

Best,

-David Torres - AdWords API Team

Oliver

unread,
Jun 19, 2012, 8:14:48 AM6/19/12
to adwor...@googlegroups.com
Thanks David.

How else would you recommend one gets only the account structure in a way that remains consistent? Is there any other way an account structure can be fetched without using the method I described?

Oliver

Oliver

unread,
Jun 28, 2012, 3:09:13 PM6/28/12
to adwor...@googlegroups.com
I ran reports specifying only the "attribute" type of fields (as discussed in this thread) but they all come back blank.  No structural data seem to be included in the reports unless I specify "metric" or "segment" fields as well.

David, this seems to not be consistent with the recommendation you made?

I would have thought getting an account structure and syncing it every day is a basic and fundamental building block in using the API. Why is it so hard and ambiguous?

Can anyone please please help explain how one can get the account structure using reports without having to get the performance data too?

mm, if you're read this, do you have any ideas? I don't want to include any impressions in the report so I'm trying to avoid using predicate impressions >=0

Thanks in advance for any help.


Oliver


On Tuesday, June 19, 2012 1:31:39 AM UTC+1, David Torres wrote:

Kevin Winter

unread,
Jul 23, 2012, 3:26:22 PM7/23/12
to adwor...@googlegroups.com
Hi Oliver,
  If you include a field such as Impressions, while still making sure none of the other fields prevent zero impression rows from returning, you'll get back your structural data with an impression of 0 (for those with no impressions).  I.E. including the Impressions field should not prevent you from obtaining structural data.  Since reports are meant to report on the performance of the account, the reporting backend expects some sort of statistic to be included in the response.

Many customers use the CustomerSyncService for keeping accounts in sync.  By using the date range from NOW to the last time a sync occurred, you'll get back a list of entity IDs that have changed since then.  This greatly narrows the list of entities you need to retrieve to keep in sync.  You can then make a SOAP call (if its a small number) or a structural report with the Impressions column (if its a lot) to get a list of all objects that have changed.

- Kevin Winter
AdWords API Team

Brad Ruderman

unread,
Nov 17, 2015, 11:17:22 PM11/17/15
to AdWords API Forum
I would like to revisit this topic. I am currently trying to sync the KEYWORD_PERFORMANCE_REPORT, so everyday after the "data freshness time" (https://support.google.com/adwords/answer/2544985), I was running a query for the past 5 days and replacing the data. However I noticed that as of lately there is data that is not reconciling with the adwords UI. I tracked the issue down to a specific date, and reran the import to find that the data was correct. This means that the data has been changing for the past 5 days. I would like to implement the CustomerSyncService to allow me to use a sync date and then query for the changed data, though I am not sure how to interrupt the result of the CustomerSyncService i.e. the CampaignChangeData to then know which days need to be reprocessed for reporting. Can you help me understand the result of CampaignChangeData to dynamically create the query to get the new data for the keyword performance report?

Thanks!

Umesh Dengale

unread,
Nov 18, 2015, 3:11:59 PM11/18/15
to AdWords API Forum
Hello,
 
You could use the AdGroupChangeData.changedCriteria, AdGroupChangeData,removedCriteria, AdGroupChangeData.adGroupId, AdGroupChangeData.adGroupChangeStatus and similar fields from CampaignChangeData(e.g. campaignId, addedCampaignCriteria, removedCampaignCriteria etc.) from the CustomerSyncService to create the query to get the changed data for the Keyword Performance Report. Please check out CustomerSyncService and Keyword Performance Report documents for more details.

Regards,
Umesh, AdWords API Team.

Brad Ruderman

unread,
Nov 18, 2015, 6:17:20 PM11/18/15
to AdWords API Forum
I am still unclear how to determine which days have changed. I understand the "CustomerSyncService" returns back different levels that have changed, however I need to know the DAYS which data has changed for. If I pass in a min/max of last sync time, where do I then get the days that need to be reprocessed? Can you please provide some sample code as to determine which days need to be reprocessed.

Thanks,
Brad

Josh Radcliff (AdWords API Team)

unread,
Nov 18, 2015, 9:36:41 PM11/18/15
to AdWords API Forum
Hi Brad,

I don't think that CustomerSyncService is going to provide the information you want for your use case. That service returns IDs of objects that were added or removed, or whose attributes have changed during the date range specified. However, it sounds like you are looking for the IDs (or dates) of objects whose performance statistics (such as impressions, cost, etc.) have changed. Unfortunately, there isn't an API service that will provide that information.

I would recommend always replacing your locally stored performance data for the last 5 days with a fresh run of each report for the last 5 days. Is that what you're doing already?

Thanks,
Josh, AdWords API Team

Brad Ruderman

unread,
Nov 18, 2015, 10:27:52 PM11/18/15
to AdWords API Forum
Josh,
That is correct. I was doing the last 5 days of sync. I still was able to find discrepancies, looking historically from last month. I actually know exactly which record had discrepancies and when I polled that data if that helps.

Thanks,
Brad

Brad Ruderman

unread,
Nov 18, 2015, 10:39:09 PM11/18/15
to AdWords API Forum
Do you have any recommendations about how to properly sync beyond the 5 days to ensure the data is accurate and valid.

Thanks,
Brad

Josh Radcliff (AdWords API Team)

unread,
Nov 19, 2015, 4:16:03 PM11/19/15
to AdWords API Forum
Hi Brad,

You may see adjustments coming in after 5 days, although that should be somewhat rare.

One approach some users have used is:

Daily
  • Run report for the last 7 days and completely replace any previous reporting data in your DB with this information.
Monthly
Using November 2015 as an example:
  • On the 5th day of the month (11/5), run a report for all days for month - 2 and completely replace any previous reporting data in your DB. In the case of November 5 2015, you would run the report for 20150901 - 20150930.
This approach will only miss adjustments if they are made > 30 days after the report date, which is very unlikely.

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