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
// Add this below the analytics tracking: | |
if ( sectionName === 'pricing' ) { | |
setCookie( 'viewed_homepage_pricing', 'true' ); | |
} | |
// Then in your sign up event: | |
analytics.record( 'Signed Up', { | |
viewed_pricing: getCookie( 'viewed_homepage_pricing' ) === 'true' | |
} ); |
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
+------------+----------+---------+ | |
| week | plan | signups | | |
+------------+----------+---------+ | |
| 2017-01-26 | Bronze | 10 | | |
| 2017-01-26 | Gold | 55 | | |
| 2017-01-26 | Standard | 108 | | |
| 2017-02-05 | Bronze | 6 | | |
| 2017-02-05 | Iron | 1 | | |
| 2017-02-05 | Gold | 37 | | |
| 2017-02-05 | Standard | 142 | |
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
library(ggplot2) | |
data <- read.csv("dummy-data.csv", sep = "\t") | |
g <- ggplot(data, aes(x = week, y = signups, group = plan, fill = plan)) + | |
geom_area() | |
print(g) |
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
week plan | |
1 2017-01-26 Bronze | |
2 2017-02-05 Bronze | |
3 2017-02-12 Bronze | |
4 2017-02-19 Bronze | |
5 2017-02-26 Bronze | |
6 2017-01-26 Gold | |
7 2017-02-05 Gold | |
8 2017-02-12 Gold | |
9 2017-02-19 Gold |
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
week plan signups | |
1 2017-01-26 Bronze 10 | |
2 2017-01-26 Gold 55 | |
3 2017-01-26 Standard 108 | |
4 2017-02-05 Bronze 6 | |
5 2017-02-05 Iron 1 | |
6 2017-02-05 Gold 37 | |
7 2017-02-05 Standard 142 | |
8 2017-02-12 Bronze 17 | |
9 2017-02-12 Iron 2 |
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
week plan signups | |
1 2017-01-26 Bronze 10 | |
2 2017-01-26 Gold 55 | |
3 2017-01-26 Iron 0 | |
4 2017-01-26 Platinum 0 | |
5 2017-01-26 Silver 0 | |
6 2017-01-26 Standard 108 | |
7 2017-02-05 Bronze 6 | |
8 2017-02-05 Gold 37 | |
9 2017-02-05 Iron 1 |
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
data <- read.csv("data.csv", sep = "\t") | |
weeks <- unique(data$week) | |
plans <- unique(data$plan) | |
combinations <- expand.grid(week = weeks, plan = plans) | |
data <- full_join(data, combinations, by = c("week" = "week", "plan" = "plan")) %>% | |
mutate(signups = ifelse(is.na(signups), 0, signups)) %>% | |
arrange(week, plan) |
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
data <- read.csv("data.csv", sep = "\t") | |
data <- data %>% | |
tidyr::spread(key = plan, value = signups, fill = 0) %>% | |
tidyr::gather(key = plan, value = signups, - week) %>% | |
arrange(week, plan) | |
g <- ggplot(data, aes(x = week, y = signups, group = plan, fill = plan)) + | |
geom_area(position = "stack") |
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
week Bronze Gold Iron Platinum Silver Standard | |
1 2017-01-26 10 55 0 0 0 108 | |
2 2017-02-05 6 37 1 0 0 142 | |
3 2017-02-12 17 42 2 0 0 119 | |
4 2017-02-19 11 26 0 1 4 70 | |
5 2017-02-26 13 0 0 0 5 52 |
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
week plan signups | |
1 2017-01-26 Bronze 10 | |
2 2017-01-26 Gold 55 | |
3 2017-01-26 Iron 0 | |
4 2017-01-26 Platinum 0 | |
5 2017-01-26 Silver 0 | |
6 2017-01-26 Standard 108 | |
7 2017-02-05 Bronze 6 | |
8 2017-02-05 Gold 37 | |
9 2017-02-05 Iron 1 |