-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding segments.device doesn't work #43
Comments
Same issue with segments.product_item_id Most likely happens with more segments. |
Could you please test and validate your query with the Google Ads Query Builder: https://developers.google.com/google-ads/api/fields/v10/query_validator SELECT
campaign.name,
campaign.status,
segments.device,
metrics.impressions,
metrics.clicks,
metrics.ctr,
metrics.average_cpc,
metrics.cost_micros
FROM campaign
WHERE segments.date DURING LAST_30_DAYS
AND metrics.impressions > 0
PARAMETERS include_drafts=true |
Yes both are valid according to the link you provided
|
If means anything I can get segments.device to work when the table is FROM ad_group |
@sshemtov Thank you for the SQL queries. Both queries return data from my Google Ads account with shopping campaigns and there is no error. |
0 clue what I'm doing wrong then. Works when I remove segments.device, then doesn't work when I add it in. |
@sshemtov Can you run the query again with test_query <- "SELECT customer.descriptive_name, segments.product_item_id, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.conversions_value , metrics.search_absolute_top_impression_share, metrics.search_impression_share, metrics.search_click_share FROM shopping_performance_view WHERE segments.date BETWEEN '2022-03-22' AND '2022-04-27'"
test_query_2 <- "SELECT segments.date, customer.descriptive_name, campaign.name, ad_group.name, segments.device , metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions_value , segments.product_custom_attribute1, segments.product_type_l1 FROM shopping_performance_view WHERE segments.date BETWEEN '2022-01-27' AND '2022-04-27'"
my_service = googleAdsSearch(
aid = '*************',
query = test_query,
api_version = 'v10'
)
data <- query_google_ads(
mcc_id = '***-***-****',
google_auth = google_auth,
service = my_service,
raw_data = T,
convert_micros = 1e6
) And print the message if there is an error: a <- fromJSON(rawToChar(data$content))
a |
@jburkhardt I was already doing raw_data = F Here is error: a <- fromJSON(rawToChar(data$content)) |
`> a <- fromJSON(rawToChar(data$content))
|
Updated above: |
raw = T gets me this error now Error in df[, grepl("metrics.", names(df))] : |
This code works just fine for me with both of your queries: test_query <- "SELECT customer.descriptive_name, segments.product_item_id, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.conversions_value , metrics.search_absolute_top_impression_share, metrics.search_impression_share, metrics.search_click_share FROM shopping_performance_view WHERE segments.date BETWEEN '2022-03-22' AND '2022-04-27'"
test_query_2 <- "SELECT segments.date, customer.descriptive_name, campaign.name, ad_group.name, segments.device , metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions_value , segments.product_custom_attribute1, segments.product_type_l1 FROM shopping_performance_view WHERE segments.date BETWEEN '2022-01-27' AND '2022-04-27'"
my_service = googleAdsSearch(
aid = '**********',
query = test_query_2,
api_version = 'v10'
)
data <- query_google_ads(
mcc_id = '***-***-****',
google_auth = google_auth,
service = my_service,
raw_data = F,
convert_micros = 1e6
)
data As I cannot reproduce the issue it is difficult to support! |
@sshemtov Please make sure you use the latest version of r4googlads 0.1.1 |
@jburkhardt just tried remotes::install_github("banboo-data/r4googleads"), still didn't work |
full code with X's for account info `remotes::install_github("banboo-data/r4googleads") google_auth <- authenticate() test_query <- "SELECT customer.descriptive_name, segments.product_item_id, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.conversions_value , metrics.search_absolute_top_impression_share, metrics.search_impression_share, metrics.search_click_share FROM shopping_performance_view WHERE segments.date BETWEEN '2022-03-22' AND '2022-04-27'" my_service = googleAdsSearch( data <- query_google_ads( |
Error in data.frame(..., check.names = FALSE) : |
Hello,
Came across this error when trying to add segments.device to my query.
Error:
arguments imply differing number of rows: 10000, 5774
Might need to use cbind( ) instead of c( ) somewhere?
Thanks
The text was updated successfully, but these errors were encountered: