How to get " adwords campaign, adgroup " name in CSV.

133 views
Skip to first unread message

Naresh Kumar

unread,
Jun 29, 2015, 2:32:44 PM6/29/15
to adwor...@googlegroups.com
i am using this below code to get Adwards Campaign data reports in CSV.
I want to
get " adwords campaign, adgroup ".
with this below code i am getting error Invalid field name in CampaignName

            $user
= new AdWordsUser();
            $user
->SetOAuth2Info($oauth2_info);
            $user
->SetClientCustomerId($client_id);
            $user
->LogAll();

            $user
->LoadService('ReportDefinitionService', ADWORDS_VERSION);


           
// Create selector.
            $selector
= new Selector();
            $selector
->fields = array(
               
'AdGroupId',
               
'CampaignId',
               
'CampaignName',
               
'GclId',
               
'CriteriaId',
               
'CriteriaParameters',
               
'Date'
           
);


           
// Create report definition.
            $reportDefinition
= new ReportDefinition();
            $reportDefinition
->selector = $selector;
            $reportDefinition
->reportName = 'Click Performance Report #' . uniqid();
            $reportDefinition
->dateRangeType = 'CUSTOM_DATE';


            $dateRange
= new DateRange();

            $dateRange
->min = $start_date;
           
//$dateRange->min = "20150626";
            $dateRange
->max = $end_date;
           
//$dateRange->max = "20150626";

            $selector
->dateRange = $dateRange;

           
//pr($dateRange); die;
            $reportDefinition
->reportType = 'CLICK_PERFORMANCE_REPORT';
            $reportDefinition
->downloadFormat = 'CSV';

           
// Exclude criteria that haven't recieved any impressions over the date range.
            $reportDefinition
->includeZeroImpressions = FALSE;

           
// Set additional options.
            $options
= array('version' => ADWORDS_VERSION);
            $path
= $this->path;
            $file_name
= 'click_performance_report_' . time() . ".csv";
            $this
->file_name = $file_name;
            $filePath
= $path . $file_name;

           
// Download report.
           
ReportUtils::DownloadReport($reportDefinition, $filePath, $user, $options);

            $flag
= true;

Anthony Madrigal

unread,
Jun 29, 2015, 2:37:50 PM6/29/15
to adwor...@googlegroups.com, naresh.we...@gmail.com
Hi,

When using the Click Performance Report, you will not be able to select the fields CampaignName or AdGroupName. 

The only fields available are the ones listed in that document. The closest fields to what you want are the CampaignId and AdGroupId.

Regards,
Anthony
AdWords API Team

Naresh Kumar

unread,
Jun 29, 2015, 2:41:54 PM6/29/15
to adwor...@googlegroups.com, naresh.we...@gmail.com
Hi,

Very thank you for you Reply.. i understand .
But i want CampaignName or AdGroupName. How could i get these two ?

Thank you

Anthony Madrigal

unread,
Jun 29, 2015, 2:52:28 PM6/29/15
to adwor...@googlegroups.com, naresh.we...@gmail.com
Hi,

You won't be able to get those fields using the Click Performance Report. You could check the other Report Types to see which ones use AdGroupName and CampaignName to see which type suits your needs best.

Johan Hedin

unread,
Jun 29, 2015, 6:13:58 PM6/29/15
to adwor...@googlegroups.com
Hi Anthony
So how to import the adgroups and the campaigns as well?

Thanks a lot for your help.

Best
Johan

Johan Hedin

unread,
Jul 1, 2015, 9:40:43 AM7/1/15
to adwor...@googlegroups.com
Hi ANthony
So that report will also import the display partners as well?

If not which report would that be?

Thanks a lot for your assistance...

best
Johan

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/sc-13aJEgMw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/0715078b-4cb7-4851-a7ad-3ddca0c6cb69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Please let me know if you have any further questions or concerns and I will be happy to help you more.

Kind Regards,

Johan Hedin

Managing Director 

15 Years Experience


Marketing Ignite Co. Ltd.
2922/144 Charn Issara Tower 2
4th Fl. Suite 406, New Petchburi Road
Bangkapi, Huay Kwang
Tel: +66(0) 89 06 32 858

SEO Training Course
www.marketingignite.com/SEO-Training-Course
Twitter: twitter.com/Marketingignite

11734 Wilshire Blvd C1105
Los Angeles CA 90025
U.S.A.
+ 1 (310) 584 7293

Pankaj Pandey

unread,
Jul 1, 2015, 1:03:04 PM7/1/15
to adwor...@googlegroups.com, naresh.we...@gmail.com
Hi i want to make a report with this function

static mixed DownloadReportWithAwql (string $reportQuery, [string $path = NULL], AdWordsUser $user,  $reportFormat, [array $options = NULL], string $reportFormat:)

Can you please elaboarate me what is $reportFormat in this?

Anthony Madrigal

unread,
Jul 1, 2015, 1:53:24 PM7/1/15
to adwor...@googlegroups.com, jo...@marketingignite.com
Hi Johan,

Yes, the Click Performance Report will be able to include stats for display networks.

If you want your report broken down by Network type, you can include either the field AdNetworkType1 or AdNetworkType2.

Anthony Madrigal

unread,
Jul 1, 2015, 2:09:39 PM7/1/15
to adwor...@googlegroups.com, pankajpa...@gmail.com
Hi Pankaj,

The reportFormat refers to the type of file you would like your report to be (e.g. CSV, TSV, XML, etc). The Reporting Basics guide provides a detailed description of the formats. 

Cheers,
Anthony
AdWords API Team

Johan Hedin

unread,
Jul 1, 2015, 2:10:53 PM7/1/15
to Anthony Madrigal, adwor...@googlegroups.com, Ranjeet Staplelogic
Hi Anthony,
Great thanks. So then you can see which display partner is sending the traffic and lead right in the click performance report?

Best
Johan

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/sc-13aJEgMw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.

For more options, visit https://groups.google.com/d/optout.

Johan Hedin

unread,
Jul 1, 2015, 2:13:22 PM7/1/15
to Anthony Madrigal, adwor...@googlegroups.com, pankajpa...@gmail.com
Thanks a lot Anthony.

So does the click performance report show the exact display partner as well?

We need this to show as well..

Thanks a lot for your help :-)

Best
Johan

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/sc-13aJEgMw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.

For more options, visit https://groups.google.com/d/optout.

Anthony Madrigal

unread,
Jul 1, 2015, 2:19:55 PM7/1/15
to adwor...@googlegroups.com, jo...@marketingignite.com
Hi Johan,

If you use one of the AdNetworkType fields then your stats will be broken down by network types such as Display and Search.

In your report, you will see which network types are associated to each click. It will not show which Display partner, only that it was a Display partner.

Johan Hedin

unread,
Jul 1, 2015, 2:26:20 PM7/1/15
to Anthony Madrigal, adwor...@googlegroups.com, Ranjeet Staplelogic
Hi Anthony
So how to get the display partner detail information then (referring urls)?

Best
Johan

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@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 a topic in the Google Groups "AdWords API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/sc-13aJEgMw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at http://groups.google.com/group/adwords-api.

For more options, visit https://groups.google.com/d/optout.

Anthony Madrigal

unread,
Jul 1, 2015, 2:33:29 PM7/1/15
to adwor...@googlegroups.com, jo...@marketingignite.com
Hey Johan,

There was a recent forum post that details how to get the URLs of the Display Network partners. 

Naresh Kumar

unread,
Jul 2, 2015, 10:14:49 AM7/2/15
to adwor...@googlegroups.com, jo...@marketingignite.com
Hi Anthony,

I have successfully Imported Campaign name and AdGroup name..
I also want to fetch Partner Site URL from which User came on My site.

I have imported a URL Performance Report on the basis of Campaign Id.
But now i have so many URL for a Campaign Id.

I want only one Partner Site URL from which User came on My site. i have only Gclid,campaign id, adgroup id.

Thank You

Johan Hedin

unread,
Jul 2, 2015, 5:49:06 PM7/2/15
to Naresh Kumar, adwor...@googlegroups.com

Hi Anthony
If we want to find out which partner who inquired would we use the placement parameters in the urls? Is that going to be an issue after july 1st upgrade of adwprds urls? If you change to this will the old statistics be gone then? Is the placement parameters the best option if we want to find out which partners send traffic that convert to a lead which is wht we want to find out.

Could you let me know pls.

Best
Johan



Anthony Madrigal

unread,
Jul 6, 2015, 6:46:56 PM7/6/15
to adwor...@googlegroups.com, jo...@marketingignite.com, naresh.we...@gmail.com
Hi guys,

@Naresh: If you use the URL Performance Report and include the field Url, then you will get the URL of the partner site. You could modify the report query so that it only checks the one partner site URL you want (e.g. WHERE Url = 'YOUR_PARTNER_URL_HERE').

@Johan: You can use ValueTrack parameters to track your placements using the parameter {placement}. You will still be able to get reports on old stats using the destination URL, but it will be read-only. 

Johan Hedin

unread,
Jul 22, 2015, 11:21:54 AM7/22/15
to AdWords API Forum, naresh.we...@gmail.com
Hi Anthony
Currently we are using referral url params to get the source information for each partner. So basically if someone click on an ad on our partner site, the partner url should come into the platform and report this. The problem is that sometimes it does and sometimes it doesn't. How reliable is this method? Do you know why this is the case and what is the solution to use to get the referral partner url and the page where the ad shows up all the time?  We are not manually entering the partner urls in the display network but let Google show on any relevant website as we target based on topic or keywords in the display campaign...Here is an example of a url that I get once i click on a partner site and come to our website below...But the partner url did not get reported...


Thanks for your help and looking forward to your response...


Best
Johan

Anthony Madrigal

unread,
Jul 22, 2015, 8:40:16 PM7/22/15
to AdWords API Forum, jo...@marketingignite.com, naresh.we...@gmail.com
Hi Johan,

You could try the suggestion I made to Naresh earlier. Run a URL Performance Report with the field Url since that is the URL of the partner site. 

Naresh Kumar

unread,
Jul 27, 2015, 11:29:23 AM7/27/15
to AdWords API Forum, jo...@marketingignite.com, adwordsapiadvi...@google.com

Hello Mr. Anthony,


Thank you for your support.


but problem is same here.

Here is the random url of Google Display Partner URL where my ads are displaying by Google i.e whiteboardexplainers.com

http://awesomescreenshot.com/07d53ls86b


when user clicks on my ads i.e on thaivisa.com ( for example ) and lands on my site whiteboardexplainers.com index page.


i want to get URL from where user came to my website.


Currenlty i am getting gclid when user lands on my site whiteboardexplainers.com

Like this http://www.whiteboardexplainers.com/?gclid=CNykj6mO-8YCFUQJvAodJb4MSQ


I have fetched campaign id and adgroup id using Performance Reports using Google Adwords API.

I have also tried URL PERFORMANCE REPORT

using $reportQuery = "select CampaignId, AdGroupId ,Url, ConversionTrackerId from URL_PERFORMANCE_REPORT WHERE CampaignId = xxxxxxxxx ";


But i am getting so many URL'S that is related with campaign.


How could i get particular one URL (for example thaivisa.com). My ads was showing there when user clicks in it. It could be differ. I want to get this thaivisa.com on my end in Reports using Ads API.


Mr. Anthony, you have sugested me to do this below:

e.g. WHERE Url = 'YOUR_PARTNER_URL_HERE'


But problem is there i can't use this WHERE Url = 'YOUR_PARTNER_URL_HERE'.

Because i don't know from where user came.


I have also tried it with referrel URL using javascript on my end. but sometime i got URL parameter in that referrel url and sometime not. Why is this happening ..?


Please suggest me is it possible to get that particular URL from user came to my website if yes then how ?



Example:

If my Ad is showing on www.xyz.com and user clicks on it. Then it goes my webportal.

now how i can get using Report with Ads API that from where my user came i.e. www.xyz.com


I have only “ gclid “.


Thank You

Johan Hedin

unread,
Jul 28, 2015, 9:32:32 PM7/28/15
to Anthony Madrigal, AdWords API Forum, Naresh Kumar
Hi Anthony
My developer Naresh is a little stuck on the api thing with the adwords partners. 

All we need to have is to get the referring url to be passed on to our platform. Basically we use the google adwords display and target by keywords or topic so Google picks the partners for us automatically. 

Can you please assist him in this so we can solve this issue so that the partner url shows up in our platform please...

Thank you very much for your assistance here...


Best
Johan

Johan Hedin

unread,
Jul 29, 2015, 6:38:40 PM7/29/15
to AdWords API Forum, Anthony Madrigal, Naresh Kumar
Hi Anthony
To confirm the url performance report would take all the referring urls (www.xyz.com/yadayday.com and not just the referring domain name www.xyz.com correct?

Also it works on an automatic placement campaign as well (ie we do not need to manually enter in the url in the adwords platform correct?)....

Best
Johan

On Wed, Jul 29, 2015 at 9:42 PM, <adwor...@googlegroups.com> wrote:
Hi Johan,

The best AdWords API has to offer is to use the Url Performance Report to capture the URLs. 

However, if that is not what you want I suggest modifying your site to capture the referring address and to save it alongside the gclid. This would be a custom solution and is not a functionality on the AdWords API side.
Reply all
Reply to author
Forward
0 new messages