This file contains hidden or 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
| -- this query outputs a data visualisation to explore how many unique products people | |
| -- see on your website, and the conversion rate | |
| -- it uses Big Query SQL on a GA4Dataform events table - check https://github.com/superformlabs/ga4dataform-community | |
| with products_per_user as ( | |
| SELECT | |
| user_pseudo_id, | |
| count( distinct if(event_name = 'view_item', i.item_name, NULL) ) as n_items_viewed, | |
| max( if(event_name = 'purchase', 1, 0)) as purchaser |
This file contains hidden or 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(googleAuthR) | |
| library(googleAnalyticsR) | |
| library(tidyverse) | |
| library(bigQueryR) | |
| library(rvest) | |
| library(lubridate) | |
| # Last Financial Week | |
| end_date <- floor_date(Sys.Date(),"week") - 1 | |
| start_date <- end_date - 6 |
This file contains hidden or 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
| (function () { | |
| // gets hotjar user id (hjUID) | |
| var hjUID = ""; | |
| try { | |
| if (typeof (hj) != "undefined" && hj.hasOwnProperty("globals")) { | |
| // sample: a21c0a02-3b48-53c6-94b4-5604e281e5d8 | |
| // the value before the first "-" ("a21c0a02") is the user identifier that can be referenced in the hj interface | |
| // use the following snippet to return only the user identifier (eg// "a21c0a02"): | |
| // hjUID =hj.globals.get("userId").split("-").shift(); |
This file contains hidden or 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
| /** | |
| * Unpivot a pivot table of any size. | |
| * | |
| * @param {A1:D30} data The pivot table. | |
| * @param {1} fixColumns Number of columns, after which pivoted values begin. Default 1. | |
| * @param {1} fixRows Number of rows (1 or 2), after which pivoted values begin. Default 1. | |
| * @param {"city"} titlePivot The title of horizontal pivot values. Default "column". | |
| * @param {"distance"[,...]} titleValue The title of pivot table values. Default "value". | |
| * @return The unpivoted table | |
| * @customfunction |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| # ############################### # | |
| # A/B TESTING (START) # | |
| # ############################### # | |
| # (1) Check if our cookie is already set. | |
| # If so, redirect to the previously-viewed page. | |
| RewriteCond %{HTTP_COOKIE} ab_test_vers=([^;]+) | |
| RewriteRule ^THE-PAGE-BEING-TESTED$ HTTP://YOUR-DOMAIN.COM/tracking/%1 [cookie=ab_test_vers_match:true:YOUR-DOMAIN.COM,L] |
This file contains hidden or 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
| # R source code for all slides/videos in Albert Y. Kim's "Modeling with Data in | |
| # the Tidyverse" DataCamp course: | |
| # https://www.datacamp.com/courses/modeling-with-data-in-the-tidyverse | |
| # This code is available at http://bit.ly/modeling_tidyverse | |
| # Load all necessary packages ----- | |
| library(ggplot2) | |
| library(dplyr) | |
| library(moderndive) |
This file contains hidden or 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("igraph") | |
| # Swap out path to your Screaming Frog All Outlink CSV. For Windows, remember to change backslashes to forward slashes. | |
| links <- read.csv("C:/Documents/screaming-frog-all-outlinks.csv", skip = 1) # CSV Path | |
| # This line of code is optional. It filters out JavaScript, CSS, and Images. Technically you should keep them in there. | |
| links <- subset(links, Type=="AHREF") # Optional line. Filter. | |
| links <- subset(links, Follow=="true") | |
| links <- subset(links, select=c(Source,Destination)) | |
| g <- graph.data.frame(links) | |
| pr <- page.rank(g, algo = "prpack", vids = V(g), directed = TRUE, damping = 0.85) | |
| values <- data.frame(pr$vector) |
This file contains hidden or 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
| /********************************************************************************************************************** | |
| * Amazon Autocomplete Tool | |
| * Leverage the Amazon Autocomplete feature to find highly commercial keyword opportunities. | |
| * Export the results for efficient importing into Google Adwords | |
| * Version 1.0 | |
| * Created By: Derek Martin | |
| * DerekMartinLA.com or MixedMarketingArtist.com | |
| **********************************************************************************************************************/ | |
| var hashMapResults = {}; |
This file contains hidden or 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
| #install.packages("rjson","RCurl") | |
| library(RCurl) | |
| library(rjson) | |
| get_User_subs_page = function(user, after=NULL, cache=c()){ | |
| baseurl = "http://www.reddit.com/user/" | |
| params = "limit=100" | |
| if(!is.null(after)){ | |
| params = paste(params, "&after=",after, sep="") |
NewerOlder