AdWords
4.9K members online now
4.9K members online now
Dive into advanced features like Remarketing, Flexible Bid Strategies, AdWords Editor, and AdWords Scripts
Guide Me
star_border
Reply

Problem with Conversion Stats in AdWords Scripts

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi everyone, my name is Tom and I've been working with AdWords Scripts for about a year now - I'm a huge fan of all the fun automated things you can do with a little bit of coding! Throughout this year, I set up a number of enhanced alerts that go beyond the rules we can create in the interface, and many of these rely on the .getStatsFor() call to filter for only keywords meeting specific criteria (such as high CPA).

 

Everything was working well until we recently switched over from counting "converted clicks" to specifically tracking each conversion action leading to a form completion. For our purposes we only set the form submissions to be counted as conversions. Because of that, the "converted clicks" value is now inflated and incorrect as it's including the extra steps we don't want to count (landing on the page, moving to the next lightbox step, etc).

 

I figured that updating all instances of .getConvertedClicks() to .getConversions() would do the trick. Unfortunately though, even after that, the script is outputting 'converted clicks' and not the 'conversions' attribute we want. Curiously enough the script runs without errors in all aspects but just does not produce the accurate conversion numbers we want.

When I checked the support articles, I found out that .getConversions() was deprecated and now instead operates like .getConvertedClicks.... Since there has been a big push lately for more granular conversion tracking, I was wondering if there was any way we could get scripts to show only the conversions we told AdWords we want counted? Our team is really confused on why getConversions() would be deprecated right before so many awesome new conversion tracking options rolled out, so I'm hoping that that feature will make a comeback soon.

 

Any suggestions? Thank you so much guys!

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by Mini-CM (Community Manager)
December 2015

Re: Problem with Conversion Stats in AdWords Scripts

Top Contributor
# 4
Top Contributor

Hi @Thomas P one problem I've run into with a couple of Accounts is conversion values being returned using thousands separators, e.g. 1,256.87.  Presumably this means the value is a typeOf String so operators like > won't work.  Have you tried simply retrieving a set of values for CostPerConversion and examining them "raw" with the Logger?

 

 

If the values look OK (i.e. they're greater than 999 and don't include separators and/or return a typeOf Number) the only other suggestion I can make is that you test using Cost and Conversions separately either within the query or by filtering the rows returned (ugh).

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

View solution in original post

Re: Problem with Conversion Stats in AdWords Scripts

Top Contributor
# 2
Top Contributor

Hi @Thomas P have you looked at using Reports rather than .getStatsFor()?  Reports offer a lot more fields (columns) than .getStatsFor including some that might be useful in your case.  Take a look:

 

https://developers.google.com/adwords/api/docs/appendix/reports/campaign-performance-report

 

Using Reports in your scripts is relatively simple - it's effectively that same as running a SQL query that returns rows.  Not only are there more columns available, but reports are a lot faster than using .getStatsFor.  I can't be certain if it'll solve your problem without experimenting, but it's worth looking into.

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits

Re: Problem with Conversion Stats in AdWords Scripts

[ Edited ]
Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Jon,

Thank you so much for the reply! In regards to your question, yes we've had some attempts to set up these reports in the past with other methods. As a work around to the conversion counting issue, we've had tried to create a similar High Cost Per Conversion script in AWQL but are still running into different issues producing the kind of report we want.

 

It seems like the conversion value that appears when we invoke the KEYWORDS_PERFORMANCE_REPORT actually does match the correct count in the interface. However, the big thing that's been us holding back in terms of AWQL is the CostPerConversion filter in the WHERE clause. For some reason although any Impressions, Clicks, etc. thresholds assigned to WHERE are applied to the query, it seems to ignore any CostPerConversion criteria.

 

As an example, I have a script set up in an account as follows:


function main() {
var spreadsheet = SpreadsheetApp.create("Conversion Test");
var report = AdWordsApp.report(

 

"SELECT Criteria,KeywordMatchType,Labels,LabelIds,Clicks,Impressions,Cost,Ctr,Conversions,ConversionRate,CostPerConversion " +
" FROM KEYWORDS_PERFORMANCE_REPORT " +
" WHERE " +
" CostPerConversion > 25000000" +
" AND Impressions > 0" +
" DURING LAST_7_DAYS");
var rows = report.rows();

report.exportToSheet(spreadsheet.getActiveSheet());
Logger.log("Report available at " + spreadsheet.getUrl());
}

 

 

It's a simple script that's meant to return a Google Sheet with any keywords that have a CPA over $25. The value was multiplied by 1000000 as recommended by Anash Oomen in an earlier post, but I'm still running into the same issue regardless of using '25' or '25000000' - both items with 0 conversions and a CPA of 0 show up.

 

In the link I provided to Anash's workaround the bug was reported around August '13, but I could not find any updated information on whether or not it's been patched. Am I still using the correct query to pull this high CPA report, or is there a new updated WHERE clause criteria I should use?


Thanks again, our team really appreciates your support and input with this uncommon issue.

Warm Regards,


Tom P

Marked as Best Answer.
Solution
Accepted by Mini-CM (Community Manager)
December 2015

Re: Problem with Conversion Stats in AdWords Scripts

Top Contributor
# 4
Top Contributor

Hi @Thomas P one problem I've run into with a couple of Accounts is conversion values being returned using thousands separators, e.g. 1,256.87.  Presumably this means the value is a typeOf String so operators like > won't work.  Have you tried simply retrieving a set of values for CostPerConversion and examining them "raw" with the Logger?

 

 

If the values look OK (i.e. they're greater than 999 and don't include separators and/or return a typeOf Number) the only other suggestion I can make is that you test using Cost and Conversions separately either within the query or by filtering the rows returned (ugh).

 

Jon

AdWords Top Contributor Google+ Profile | Partner Profile | AdWords Audits