【问题标题】:Using the Adwords Traffic Estimator Service with R / ‘RAdwords’ packege使用带有 R / ‘Adwords’ 包的 Adwords Traffic Estimator 服务
【发布时间】:2018-09-06 11:39:54
【问题描述】:

所以我需要通过 Google Adwords 获得一些关键字的流量估算。我看到 Google 有一个流量估算器服务 API:https://developers.google.com/adwords/api/docs/guides/traffic-estimator-service。

我正在使用 R,它有一个非常全面的 RAdwords 包 https://jburkhardt.github.io/RAdwords/faq/,但是我很遗憾地找不到它提供对这个特定 Adwords API 服务的访问的天气。

那么有人使用 R 通过流量估算器从 Google 广告词中获取关键字数据吗?是否可以使用 RAdwords 软件包,还是需要通过经典脚本来完成?

提前致谢。

【问题讨论】:

    标签: r google-ads-api


    【解决方案1】:

    【讨论】:

      【解决方案2】:

      有一个名为 RAdwordsPlus 的 R 包,它建立在 RAdwords 之上,可以做到这一点。

      devtools::install_github("adviso/RAdwordsPlus")
      
      library(RAdwordsPlus)
      
      google_auth <- doAuth()  # requires user interaction the first time
      
      api_version <- "v201809"
      
      customer_id <- "xxx-xxx-xxxx"
      
      # Build keyword request
      k <- keyword(
          text = c("mars cruise", "cheap cruise", "cruise"),
          match.type = c("BROAD", "PHRASE", "EXACT"),
          type = "Keyword"
      )
      
      # Keyword estimate request
      ker <- keyword.estimate.request(
          keyword = k,
          max.cpc = 5000000,  # 1 million == one unit (microamaounts)
          is.negative = FALSE
      )
      
      # AdGroupEstimateRequest
      aer <- adgroup.estimate.request(ker)
      
      # Criteria for CampaignEstimateRequest
      cer_criteria <- vector("list", length = 2)
      cer_criteria[[1]] <- as.criterion(id = "2826", type = "Location") # united kingdom
      cer_criteria[[2]] <- as.criterion(id = "1000", type = "Language")   # english
      
      # CampaignEstimateRequest
      cer <- campaign.estimate.request(aer, campaign.id = NULL, criteria = cer_criteria)
      
      # Build the request
      request <- traffic.estimator.request(cer)
      
      # Download data from the API
      r <- get.service(request     = request,
                       cid         = customer_id,
                       auth        = google_auth,
                       api.version = api_version,
                       user.agent  = "r-adwordsplus-test",
                       verbose     = TRUE)
      

      【讨论】:

      • 太棒了。这是一篇很老的帖子,我已经忘记了,只是继续用 Python 提取它。有时肯定会尝试一下。 !!
      猜你喜欢
      • 1970-01-01
      • 2014-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多