Skip to content
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

dublicate number of columns #45

Open
mmadmar opened this issue Jun 8, 2022 · 0 comments
Open

dublicate number of columns #45

mmadmar opened this issue Jun 8, 2022 · 0 comments

Comments

@mmadmar
Copy link

mmadmar commented Jun 8, 2022

I see a strange behaviour when I do the following query:

sql_query <- "SELECT segments.date, campaign.name, segments.device, metrics.cost_micros, metrics.impressions, metrics.clicks, metrics.all_conversions
FROM campaign
WHERE segments.date BETWEEN '2021-03-17' AND '2022-06-07'
AND metrics.impressions > 0
PARAMETERS include_drafts=FALSE"

query_service <- googleAdsSearch(
aid = '--****', # Google Ads Accountnr ID
query = sql_query,
api_version = 'v9'
)

data <- query_google_ads(
mcc_id = '--****',
google_auth = google_auth,
service = query_service,
raw_data = F
)

This is what I get for names(data) and nrow(data):

names(data)
[1] "campaign.resourceName" "campaign.name" "metrics.clicks" "metrics.costMicros" "metrics.allConversions" "metrics.impressions" "segments.device"
[8] "segments.date" "campaign.resourceName" "campaign.name" "metrics.clicks" "metrics.costMicros" "metrics.allConversions" "metrics.impressions"
[15] "segments.device" "segments.date"

nrow(data)
[1] 10000

The columns are dublicated. The values in the column are not dublicated. Instead of 8 columns I get 16 columns.
Please see image below

image

This issue might have something to do with the amount of data, that I am trying to pull vom Google Ads.

This issue might also be related to #43.
When I extend the data range by one day in the above query to "BETWEEN '2021-03-16' AND '2022-06-07'" I also get the error "arguments imply differing number of rows: 10000, 28".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant