I'm need to get GCLID value inside my android app. What i found is Play Install Referrer Library, that returns me a utm tags, but i'm not sure that GCLID value will be inside val referrer = response.installReferrer

Code sample:

 fun getGCLID(){         referrerClient = InstallReferrerClient.newBuilder(this).build()         referrerClient.startConnection(object : InstallReferrerStateListener {             override fun onInstallReferrerSetupFinished(responseCode: Int) {                 when (responseCode) {                     InstallReferrerClient.InstallReferrerResponse.OK -> {                         // Connection established.                         val response: ReferrerDetails = referrerClient.installReferrer                         val referrer = response.installReferrer                         val clickTimestamp = response.referrerClickTimestampSeconds                         val installTimestamp = response.installBeginTimestampSeconds                         Log.d("TagGCLID", "onInstallReferrerSetupFinished: 1")                         if ("gclid" in referrer) {                             Log.d("TagGCLID", "GCLID is detected in referrer // is $referrer")                             //report to Firebase Analytics                         } else {                             Log.d("TagGCLID", "no GCLID is detected in referrer\n" +                                     "$referrer")                             //do something else                         }                     }                     InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> {                         Log.d("TagGCLID", "InstallReferrerResponse: -1")                         // API not available on the current Play Store app.                     }                     InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE -> {                         Log.d("TagGCLID", "InstallReferrerResponse: -2")                         // Connection couldn't be established.                     }                 }             }             override fun onInstallReferrerServiceDisconnected() {                 Log.d("TagGCLID", "onInstallReferrerServiceDisconnected: -3")                 // Try to restart the connection on the next request to                 // Google Play by calling the startConnection() method.             }         })     } 

What i'm suppose to do to get GCLID value?

We've followed the advice given here: https://developers.google.com/google-ads/api/docs/client-libs/java/logging

Neither of the proposed solutions have any visible effect on what is logged to the console, either in dev or in deployment.

Specifically:

  • added to pom.xml:

      <dependency>       <groupId>org.slf4j</groupId>       <artifactId>slf4j-log4j12</artifactId>       <version>1.7.25</version>   </dependency> 
  • added -Dlog4j.configuration=googleads-logging/log4j.properties to the launch command

no effect.

  • added to pom.xml:

      <dependency>       <groupId>org.slf4j</groupId>       <artifactId>slf4j-jdk14</artifactId>       <version>1.7.25</version>   </dependency> 
  • created jdk-logger.properties in various places, from example found here

  • added -Djava.util.logging.config.file= to the launch command

no effect whatsoever.

We are desperately trying to sort out this issue before Google sunsets the googleads v2 API on October 21. It would be really nice to see exactly what is happening, but so far all we've managed to determine is the endpoint server: googleads.googleapis.com:443

Any advice highly appreciated!

Google has the following docs for the ad manager here. Unfortunately their example:

# Set the start and end dates of the report to run (past 8 days). end_date = date.today() start_date = end_date - timedelta(days=8) # Create report job. report_job = {     'reportQuery': {         'dimensions': ['LINE_ITEM_ID', 'LINE_ITEM_NAME'],         'columns': ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS',                     'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE',                     'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'],         'dateRangeType': 'CUSTOM_DATE',         'startDate': start_date,         'endDate': end_date     } } # Initialize a DataDownloader. report_downloader = client.GetDataDownloader(version='v202008') try:   # Run the report and wait for it to finish.   report_job_id = report_downloader.WaitForReport(report_job) except errors.AdManagerReportError as e:   print('Failed to generate report. Error was: %s' % e) with tempfile.NamedTemporaryFile(     suffix='.csv.gz', mode='wb', delete=False) as report_file:   # Download report data.   report_downloader.DownloadReportToFile(       report_job_id, 'CSV_DUMP', report_file) 

yields a KeyError: 'date' on the report_job_id line. My authorization is correct and I can make other calls with my client. My question is, how does one need to update report_job in order for the example to work. I tried changing 'dateRangeType' however this states it must be 'CUSTOM_DATE'.

If I enable Auto tagging for my Google ad URLs, is the gclid parameter the only parameter that gets added?

Like "?gclid=xyz123"?

No "utm_source" or "utm_medium" or anything else gets added as well?

Reason for confirming is the destination collecting the referral data says they can only handle on key/value parameter.

Thanks!

When you set up a campaign in google adwords you can add negative keywords to it so that the searchquery may not match your campaign if it has the negative keyword.

I want to extract the list of the negative keywords per each campaign. In the documentation I was able to find this example:

def retrieve_negative_keywords(report_utils)   report_definition = {     :selector => {       :fields => ['CampaignId', 'Id', 'KeywordMatchType', 'KeywordText']     },     :report_name => 'Negative campaign keywords',     :report_type => 'CAMPAIGN_NEGATIVE_KEYWORDS_PERFORMANCE_REPORT',     :download_format => 'CSV',     :date_range_type => 'TODAY',     :include_zero_impressions => true   }   campaigns = {}   report = report_utils.download_report(report_definition)   # Slice off the first row (report name).   report.slice!(0..report.index("\n"))   CSV.parse(report, { :headers => true }) do |row|     campaign_id = row['Campaign ID']     # Ignore totals row.     if row[0] != 'Total'       campaigns[campaign_id] ||= Campaign.new(campaign_id)       negative = Negative.from_csv_row(row)       campaigns[campaign_id].negatives << negative     end   end   return campaigns end 

Which is written in Ruby and there are no Python examples for this task. There is also a report for the negative keywords but it holds no metrics and I can't use it to retrieve the list of negative keywords per each campaign.

I am using this structure to query the database:

report_query = (adwords.ReportQueryBuilder()                         .Select('CampaignId', 'Id', 'KeywordMatchType', 'KeywordText')                         .From('CAMPAIGN_NEGATIVE_KEYWORDS_PERFORMANCE_REPORT')                         .During('LAST_7_DAYS')                         .Build()) 

But querying it gives an error:

googleads.errors.AdWordsReportBadRequestError: Type: QueryError.DURING_CLAUSE_REQUIRES_DATE_COLUMN

When I add Date it throws the same error.

Has anyone been able to extract the negative keyword list per campaign using Python with the Google Adwords API reports?