Created
April 27, 2015 15:48
-
-
Save chipoglesby/de50b090794cb2603273 to your computer and use it in GitHub Desktop.
ad_id in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ad_id <- data %>% group_by(CustomerID, Campaign, Adgroup, AdID) %>% summarize( | |
AverageCpc=round(sum(Cost) / sum(Clicks),2), | |
Clicks=sum(Clicks), | |
Impressions=sum(Impressions), | |
CTR=round(sum(Clicks) / sum(Impressions),2), | |
Cost=round(sum(Cost),2), | |
Conversions=sum(Conversions), | |
CPA=round(sum(Cost) / sum(Conversions),2), | |
ConversionRate=round(sum(Conversions) / sum(Clicks), 2)) | |
ad_id[ad_id==Inf] <- 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment