Skip to content

Instantly share code, notes, and snippets.

View justinboyle's full-sized avatar

justin boyle justinboyle

  • Branding Brand
  • Pittsburgh
View GitHub Profile
var loc = window.location.pathname
, site = {
'spx' : 'SPX',
'str' : 'STR',
'rhl' : 'RHL',
'lya' : 'LYA'
}
, cat = ''
, map = {
'swm' : 'Swim',
@justinboyle
justinboyle / analytics.js
Created December 9, 2013 20:48
google analytics
function uniAnalytics(UA) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-' + UA +'-2', 'acehardware.com'); //setAccount
ga('send', 'pageview'); //pageview
}
@justinboyle
justinboyle / kenshoo.js
Created December 9, 2013 16:59
kenshoo pixel shoebuy
<script type="text/javascript">
var hostProtocol = (("https:" == document.location.protocol) ? "https" : "http");
document.write('<scr'+'ipt src="', hostProtocol+
'://1223.xg4ken.com/media/getpx.php?cid=d590cb3f-ec81-4da7-97d6-3013ec020455','" type="text/JavaScript"><\/scr'+'ipt>');
</script>
@justinboyle
justinboyle / analytics.js
Created November 21, 2013 21:35
/handlers/analytics.js
var requiem = require('bb-requiem')
, _ = require('underscore')
, cheerio = require('cheerio')
module.exports = function(app){
return {index: getCore()}
}
function getCore() {
FOOTUAT-144
L#215 Shop9 tag: var attrs = [fsgCart.AverageRating, fsgCart.Review.TotalReviews, '', fsgCart.PrimaryProductCategory, isShoe, isNew, '', '', '', '', '', '', '', isMulti, '', fsgCart.LongSku.replace(/\s/g,''), '', '', '', '', '', '', '', '', 'BMSM'].join(delim);
L#135 Shop 5: var attrs = [fsgCart.AverageRating, fsgCart.Review.TotalRatings, '', fsgCart.PrimaryProductCategoryId, isShoe,isNew, '', '', '', '', '', '', '', isMulti, '', longSku, '', '', '', '', '', '', '', '', '', '', '',fsgCart.Brand].join(delim);
FOOTUAT-261
l#56: pageTag += '<script>cmCreatePageviewTag("Mobile:'+ fsgCore.PageId + '","","Mobile:' + fsgCore.CategoryId + '","","");<\/'+'script>';
@justinboyle
justinboyle / lite.html
Created October 30, 2013 21:42
line 52. this is in /views/html/checkout/lite
<!-- rootElement for the Ember application -->
<div id="checkoutApplication">
<div class="checkout-application-loading loading-spinner">
<div class="loading-icon"></div>
<p class="loading-message">{{__ 'loading'}}</p>
</div>
</div>
{{handlebarsTemplate assets.views.checkout.lite name="application"}}
@justinboyle
justinboyle / tr_analytics.js
Created October 30, 2013 21:40
/assets/html/javascript/checkout/lite
Checkout.ApplicationController.reopen({
// Virtual Pageviews
routeChanged: function() {
console.log('inside');
Ember.run.next(function() {
analytics.pageview('/checkout/cc/#/' + this.currentPath);
var uri;
if(this.currentPath === 'addresses'){
uri = 'https://www.footsmart.com/OrderAddressInformation.aspx';
} else if(this.currentPath === 'payment'){
Checkout.ApplicationController.reopen({
routeChanged: function() {
Ember.run.next(function() {
analytics.pageview('/checkout/cc/#/' + this.currentPath);
App.analytics.getAnalyticScripts(this.currentPath);
}.bind(this));
}.observes('currentPath')
});
@justinboyle
justinboyle / analytics.js
Created October 30, 2013 20:33
override this as analytics.js
(function() {
Checkout.ApplicationController.reopen({
// Virtual Pageviews
routeChanged: function() {
Ember.run.next(function() {
analytics.pageview('/checkout/cc/#/' + this.currentPath);
}.bind(this));
}.observes('currentPath')
});
@justinboyle
justinboyle / route_receitp.js
Last active December 27, 2015 00:39
assets/html/javascript/checkouts/lite/foot_route.js
Checkout.ReceiptRoute.reopen({
activate: function() {
Ember.run.later(function(){
App.analytics.getAnalyticScripts('https://www.footsmart.com/OrderConfirmation.aspx');
}, 2000);
// Hide order summary accordion
this.controllerFor('application').set('showOrderSummary', false);
}
});