Skip to content

Commit

Permalink
Move Bing specific formatting of data out of mixpanel utilities funct…
Browse files Browse the repository at this point in the history
…ion. These should be decoupled.
  • Loading branch information
csalvato committed May 25, 2016
1 parent ed82d7c commit 46fee50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion BingUtilities/R/keyword_performance_data.r
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @examples
#' keyword_performance_data(from=20151216, to=20151219)
keyword_performance_data <- function(from=Sys.Date(), to=Sys.Date()) {
raw <- raw_keyword_performance_data(from, to)
raw <- BingUtilities::raw_keyword_performance_data(from, to)
cleaned <- BingUtilities::clean_raw_keyword_data(raw)
return(cleaned)
}
4 changes: 0 additions & 4 deletions MixpanelUtilities/R/clean_completed_order_events.r
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ clean_completed_order_events <- function(events_matrix){
events_data_frame <- events_data_frame %>% rename(app_user_id = id)
events_data_frame <- events_data_frame %>% mutate(app_user_id = as.numeric(as.character(app_user_id)))

#Clean up keywords info for future lookup of Keyword name with Keyword ID from Bing data.
events_data_frame <- events_data_frame %>% mutate(keyword_id = as.numeric(gsub("kwd-","",latest_ad_awkeyword)))
events_data_frame <- events_data_frame %>% select( -latest_ad_awkeyword )

return(events_data_frame)
}
4 changes: 4 additions & 0 deletions PowerSupplyUtilities/R/create_bing_event_log.r
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ create_bing_event_log <- function(from=Sys.Date(),
ppc_events <- all_ppc_raw_completed_order_events( from = from, to = to )
mixpanel_bing_conversions <- ppc_events[["bing"]]
mixpanel_bing_conversions <- clean_completed_order_events(mixpanel_bing_conversions)
#Clean up keywords info for future lookup of Keyword name with Keyword ID from Bing data.
mixpanel_bing_conversions <- mixpanel_bing_conversions %>%
mutate(keyword_id = as.numeric(gsub("kwd-","",latest_ad_awkeyword))) %>%
select(-latest_ad_awkeyword)

##### Retrieve Bing Spend/Click Data
bing_keywords_data <- BingUtilities::keyword_performance_data(from=as.Date(from), to=as.Date(to))
Expand Down

0 comments on commit 46fee50

Please sign in to comment.