Hello everyone.

When i login into my client's account i see the zero amount of availible 
funds but when i try to get remainder through API i got -9568,58! 
Furthermore when i download account_actitivies csv report i see in Total 
spent value of 71980.88 while in reply from api i got 81527.25. the "spent" 
from API is considerably higher so results calculated from API totally not 
match results from UI and report.

How i calculate reminders with API, in short : (paid - spend)

def get_paid(client, customer_id):

    query = {
        'service': 'BudgetOrderService',
        'selector': {
            'fields': ['SpendingLimit'],
        }
    }

    billing_accounts = run_query(client, customer_id, query=query)

    paid = 0
    for account in billing_accounts['entries']:
        paid += account['spendingLimit']['microAmount'] / 1000000
    return paid

minus

def get_spent(client, customer_id):
    query = '''
            SELECT CampaignId, Cost, CampaignStatus, Amount
            FROM CAMPAIGN_PERFORMANCE_REPORT
            '''
    for row in run_awql(client, customer_id, query):
        if row['Campaign ID'] == 'Total':
            return round(int(row['Cost']) / 1000000, 2)


As a result i usually get pretty precise and realistic results. But in case 
of this customer with customer_id 5668060624 i got this bizarre minus over 
9000.

I asked a question about that in technical support - their answer in short 
was that this strange data deviations might occured of possible refunds.

I still have no way to get the correct result whatever reason data 
deviated. May be my method of calculations is wrong, please give an advise, 
thanks!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/a35a3e3d-b146-4768-a7ac-0c57c930ae4f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Calcucations... Eduard Gan
    • Re: Cal... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum
    • Re: Cal... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum
    • Re: Cal... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum
    • Re: Cal... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum
    • Re: Cal... 'Milind Sankeshware (AdWords API Team)' via AdWords API Forum

Reply via email to