add in wp changes
This commit is contained in:
parent
c6d1e0b466
commit
43aae66fb2
|
|
@ -10,7 +10,7 @@ DEPENDENCIES
|
|||
ruby-protocol-buffers (= 1.2.2)
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.3.1p112
|
||||
ruby 2.4.1p111
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
2.2.15
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ DEPENDENCIES
|
|||
zip-codes
|
||||
|
||||
RUBY VERSION
|
||||
ruby 2.3.1p112
|
||||
ruby 2.4.1p111
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
|
|
|
|||
|
|
@ -65,10 +65,10 @@ class ApplicationController < ActionController::Base
|
|||
should_set = params[:utm_source] || origin.nil?
|
||||
if should_set
|
||||
if params[:utm_source]
|
||||
|
||||
cookies.permanent[:origin] = {utm_source: params[:utm_source], utm_medium: params[:utm_medium], utm_campaign: params[:utm_campaign], referrer: request.referrer }.to_json
|
||||
|
||||
elsif request.referer
|
||||
|
||||
begin
|
||||
cookies.permanent[:origin] = {utm_source: "organic", utm_medium: "organic", utm_campaign: URI.parse(request.referer).host, referrer: request.referer}.to_json
|
||||
rescue
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ gem 'redis', '3.3.3' # pinned until we are on 2.5; then remove
|
|||
gem 'redis-namespace', '1.5.3' # pinned until we are on 2.5; then remove
|
||||
gem 'oj', '3.1.3' # pinned until we are on 2.5; then remove
|
||||
gem 'bcrypt', '3.1.13'
|
||||
gem 'mimemagic', :source => 'https://int.jamkazam.com/gems/'
|
||||
#######
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,9 @@ PATH
|
|||
jam_ruby (0.1.1)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
remote: http://rubygems.org/
|
||||
remote: https://jamjam:blueberryjam@int.jamkazam.com/gems/
|
||||
remote: https://int.jamkazam.com/gems/
|
||||
specs:
|
||||
CFPropertyList (2.3.6)
|
||||
aasm (5.1.1)
|
||||
|
|
@ -572,6 +573,7 @@ DEPENDENCIES
|
|||
language_list
|
||||
logging
|
||||
mime-types (= 1.25.1)
|
||||
mimemagic!
|
||||
netaddr (= 1.5.1)
|
||||
newrelic_rpm
|
||||
nokogiri (= 1.10.10)
|
||||
|
|
|
|||
|
|
@ -81,14 +81,7 @@ function run_jamkazam() {
|
|||
}
|
||||
run_jamkazam();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Set affiliate tracking cookie if there is an `?affiliate=xxxx` parameter in the URL
|
||||
* The rails set honors this cookie, and a new user will be associated with the affiliate.
|
||||
*/
|
||||
add_action( 'init', 'process_post' );
|
||||
function process_post() {
|
||||
function track_affiliate() {
|
||||
$affiliate_id = $_GET['affiliate'];
|
||||
|
||||
$expiration = current_time( 'timestamp' ) + ( DAY_IN_SECONDS * 2 );
|
||||
|
|
@ -97,4 +90,22 @@ function process_post() {
|
|||
if(isset($affiliate_id)) {
|
||||
setcookie('affiliate_visitor', $affiliate_id, $expiration, '/', '.jamkazam.com');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function track_origin() {
|
||||
$source = $_GET["utm_source"];
|
||||
|
||||
if(isset($source)) {
|
||||
setcookie('origin', json_encode(array('utm_source' => $_GET['utm_source'], 'utm_medium' => $_GET['utm_medium'], 'utm_campaign' => $_GET['utm_campaign'])), strtotime( '+1 year' ), '/', '.jamkazam.com');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set affiliate tracking cookie if there is an `?affiliate=xxxx` parameter in the URL
|
||||
* The rails set honors this cookie, and a new user will be associated with the affiliate.
|
||||
*/
|
||||
add_action( 'init', 'process_post' );
|
||||
function process_post() {
|
||||
track_affiliate();
|
||||
track_origin();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue