welcome!
yay, you’re in…
$popup_couponpopup_emailaddress
Enjoy 25% Off
your first purchase with this code:
$popup_couponpopup_promocode
Offer valid for 30 days from sign-up. Offer not available on prior purchases, gift cards, shipping and handling, or taxes. Other exclusions may apply. superdown reserves the right to end or modify this promotion .
function doReady() {
loadGAScript();
}
function doOnLoad() {
insertGoogleSiteTag();
insertCordial(); insertFacebook(); insertFacebookPageView(); insertCJ();
insertCriteo();
insertSnapchat();
getProductDetailWithAjaxAndAddProductPixels($('#prodCode').val());
insertYahooStandard();
}
$(document).ready(function(){ doReady(); });
$(window).on('load', function() { doOnLoad(); });
function setPixelCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setTime(exdate.getTime() + exdays*24*60*60*1000); var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); document.cookie = c_name + "=" + c_value+ "; path=/"; }
function loadGAScript() {
(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','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-319064-32', 'auto'); var userid = -1; if(userid > -1){ ga('set', 'userId', userid); } ga('set', 'dimension1', global_sessionId_dimension1); ga('set', 'dimension2', global_browserId_dimension2); addGAImpressions(); //addGAProductDetails(); ga('send', 'pageview');
}
function addGAImpressions(){
var products = getImpressionProducts(); var list="/WEB-INF/view/super-down/DisplayProduct.jsp"; if(typeof products !== 'undefined' && products && products.length > 0){ // prepare data for client side push if(typeof ga !== 'undefined'){ // ga('create', 'UA-319064-32'); ga('require', 'ec'); for (var i = 0, len = products.length; i < len; i++) { product = products[i]; ga('ec:addImpression', { 'id': product.code, 'name': product.name, 'category': product.category, 'brand': product.brand, 'price' : product.price, 'list': list, 'position': product.position }); } } // prepare data for server side push var productIDs = []; products.forEach(function(product){ productIDs.push(product.code); }); gaTempMap = {}; gaTempMap['list'] = escape(list); gaTempMap['products'] = JSON.stringify(productIDs); gaTempMap['type'] = 'impression'; } } function getImpressionProducts(){ var products = []; return products; } function cordialPdPPages(product){ if (typeof product !== 'undefined' && product) { if(typeof crdl !=='undefined'){ crdl('event', 'browse',{ 'pageType' : 'Product', 'productID': product.code, 'product': product.name, 'imageUrl' : $('div.pdp__carousel>ul').length? (typeof $('div.pdp__carousel>ul').data('images')!=="undefined" ?$('div.pdp__carousel>ul').data('images')[0]:''):'' , 'brandName' : product.brand, 'department' : 'womens', 'productCategory' : (typeof product.category !== 'undefined' ? product.category : ''), 'productSubCategory' : (typeof product.subcategory !== 'undefined' ? product.subcategory : ''), 'productSubSubCategory' : (typeof product.subsubcategory !== 'undefined' ? product.subsubcategory : ''), 'productSubSubSubCategory' : (typeof product.subsubsubcategory !== 'undefined' ? product.subsubsubcategory : '') }); } } } function addGAProductDetails(product){
if (typeof product !== 'undefined' && product) { if (typeof ga !== 'undefined') { ga('require', 'ec'); ga('ec:addProduct', { 'id': product.code, 'name': product.name, 'category': product.category, 'brand': product.brand, 'price': product.price }); ga('ec:setAction', 'detail'); } gaTempMap = {}; gaTempMap['productcode'] = escape(product.code); gaTempMap['type'] = 'detail'; ga('send', 'pageview'); }
}
function getGAProduct(){
var gaProduct;
return gaProduct;
} function getProductDetailWithAjaxAndAddProductPixels(productCode){
$.ajax({ url: "/r/ajax/GetProductInfo.jsp", method: "GET", data: { code: productCode, siteflag : "S" }, success: function (json) { var productInfo = $.parseJSON(json); if (productInfo) { if(productInfo.success){
//call all your product pixels from here try{
if (typeof ga !== 'undefined') {
addGAProductDetails(productInfo); }
if (typeof fbq !== 'undefined') { addFacebookProductPixel(productInfo); }
if (typeof crdl !== 'undefined') { cordialPdPPages(productInfo); }
}catch(err){ console.error("Error in adding product pixels" +err) } } else { console.log("Error message for product info:" + productInfo.message); } } }, error: function() { console.log("Error when getting product info from the server"); } }); }
function gaAddToCartActionWithAjax(action,productCode,size,qty){
$.ajax({ url: "/r/ajax/GetProductInfo.jsp", method: "GET", data: { code: productCode, siteflag : "S" } }).success(function (json) { var productInfo = $.parseJSON(json); if (productInfo) { if(productInfo.success){ productInfo.quantity = qty; productInfo.variant = size; gaAddToCartActionProduct(action,productInfo); } else { colsole.log("Error message for product info:" + productInfo.message); } } }).error(function () { console.log("Error when getting product info from the server"); }).complete(function() { });
}
//string values in product object should be already escaped function gaAddToCartActionProduct(action,product){
if(typeof ga !== 'undefined'){ ga('create', 'UA-319064-32'); ga('require', 'ec'); if(typeof product !== 'undefined'){ ga('ec:addProduct', { 'id': product.code, 'name': product.name, 'category': product.category, 'brand': product.brand, 'variant': product.variant, 'price': product.price, 'quantity': product.quantity }); } if(action){ var actionlabel = (action === 'add') ? 'addToCart' : 'removeFromCart'; ga('ec:setAction', action); ga('send', 'event', 'product', 'click', actionlabel); } }
}
function gaAddToCartAction(action,code,name,category,brand,variant,price,quantity){
var gaProduct = {}; gaProduct.code = code; gaProduct.name = name; gaProduct.category = category; gaProduct.brand = brand; gaProduct.variant = variant; gaProduct.price = price; gaProduct.quantity = quantity; gaAddToCartActionProduct(action,gaProduct);
}
function gaCheckout(step,option){
// option can be guest,signin,paypal,alipay if(typeof ga !== 'undefined'){ ga('create', 'UA-319064-32'); ga('require', 'ec'); ga('ec:setAction','checkout', {'step': step,'option' : option}); ga('send', 'pageview'); }
}
function insertFacebook() {
if (typeof blockFB == 'undefined' || blockFB == false){ (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); }
}
function insertFacebookPageView() {
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, document,'script','https://connect.facebook.net/en_US/fbevents.js'); // Insert Your Facebook Pixel ID below. try { fbq('init', '252932592319916', { em: '', fn: '', ln: '', ph: '', ge: '', ct: '', st: '', zp: '' }); fbq('track', 'PageView');
} catch(e) { console.log(e) }
} function addFacebookProductPixel(productInfo){
fbq('track', 'ViewContent', { content_ids: [productInfo.code], content_type: 'product', value: productInfo.price, currency: 'USD' });
}
function insertFacebookAddToCart(cartTotal, productCode, price){
// Insert Your Facebook Pixel ID below. try { if(typeof fbq !== 'undefined') { fbq('track', 'AddToCart', { content_ids: [productCode], content_type: 'product', value: price, currency: 'USD' }); } } catch(e) { console.log(e); }
}
function insertCriteo() {
var st = document.createElement("script"); st.type = "text/javascript"; st.src = "//static.criteo.net/js/ld/ld.js"; st.async = true; $('head').append(st);
window.criteo_q = window.criteo_q || [];
//product page pixel window.criteo_q.push( { event: "setAccount", account: 58623 }, { event: "setCustomerId", id: "xIF3M2qjUVV4zQt2x3TIfAfSvtNxlJ"}, { event: "setHashedEmail", email: ""}, { event: "setSiteType", type: "d"}, { event: "viewItem", item: $('#prodCode').val() }
);
} function insertCordial(code, name, brandname, categoryName, retailPrice, imageUrl) { if(typeof(crdl) == 'undefined' || crdl == null) { return; }
if(false ) { cordialPlPPages(); } else if(!true){ crdl('event', 'browse',{ 'pageType' : '', 'department' : 'womens' }); }
(function(){ // general function identify cordial user coming from jebit var getParameterByName = function(name){ var url = window.location.href; name = name.replace(/[[]]/g, '$&'); var regex = new RegExp('[?&]' + name + '(=([^]*)|&"https://www.superdown.com/product/#"$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/+/g, ' ')); } var getCookie = function(name) { var value = "; " + document.cookie; var parts = value.split("; " + name + "="); if (parts.length == 2) return parts.pop().split(";").shift(); } try{ accountKey = document.querySelectorAll('script[data-cordial-track-key]')[0].getAttribute('data-cordial-track-key'); var id = getCookie('crdl_'+(accountKey || '')+'cID'); if(!(typeof id !== 'undefined')){ var cID = getParameterByName('cID'); if(typeof cID == 'string' && cID != ''){ crdl('contact', {cID: cID}, {}); } } }catch(e){} }()) } // do not call this function directly function cordialPlPPages(){ var categories = getCategoriesArray(''); crdl('event', 'browse',{ 'department' : 'womens', 'pageType' : 'Product List', 'category': '', 'subcategory': '', 'subsubcategory': '', 'searchKeyword' : '' }) } function getCategoriesArray(categories){ var categoryArr = []; if(typeof categories !== 'undefined'){ categoryArr = categories.split(":") } return categoryArr; }
function insertCriteoAddToCart(productcode){
try{
var cartProducts = []; cartProducts.push({id: productcode,price: 0.0,quantity: 1});
window.criteo_q = window.criteo_q || []; window.criteo_q.push( { event: "setAccount", account: 58623 }, { event: "setHashedEmail", email: "" }, { event: "setSiteType", type: "d" }, { event: "viewBasket", item: cartProducts} );
}catch(e){ console.log(e); } } function insertYahooStandard() {
(function (w, d, t, r, u) { w[u] = w[u] || []; w[u].push({projectId: "10000", properties: {pixelId: "10079092"}}); var s = d.createElement(t); s.src = r; s.async = true; s.onload = s.onreadystatechange = function () { var y, rs = this.readyState, c = w[u]; if (rs && rs != "complete" && rs != "loaded") { return } try { y = YAHOO.ywa.I13N.fireBeacon; w[u] = []; w[u].push = function (p) { y([p]) }; y(c) } catch (e) { } }; var scr = d.getElementsByTagName(t)[0], par = scr.parentNode; par.insertBefore(s, scr) })(window, document, "script", "https://s.yimg.com/wi/ytc.js", "dotq");
productViewYahoo($('#prodCode').val(),'detailview');
}
function productViewYahoo(productcode,actionlabel) {
if (productcode != null) { window.dotq = window.dotq || []; window.dotq.push( { 'projectId': '10000', 'properties': { 'pixelId': '10079092', 'qstrings': { 'et': 'custom', 'ea': 'ViewProduct', 'el': actionlabel, 'product_id': productcode } } }); }
}
function addToCartYahoo(productcode){
window.dotq = window.dotq || []; window.dotq.push( { 'projectId': '10000', 'properties': { 'pixelId': '10079092', 'qstrings': { 'et': 'custom', 'ea': 'AddToCart', 'product_id': productcode } } });
} function insertCordialAddToCart(action,code,name,category,brand,size,price,quantity) { if(typeof(crdl) == 'undefined' || crdl == null) { return; } var image= $('div.pdp__carousel>ul').length? (typeof $('div.pdp__carousel>ul').data('images')!=="undefined" ?$('div.pdp__carousel>ul').data('images')[0]:''):''; if(action==="remove"){ crdl('event', 'browse',{ 'pageType' : 'ShoppingBag', 'department' : 'womens' }); image=""; } // fire cartitem pixel only if user is identified
crdl([['cartitem', action, [{ 'productID': code, 'sku': code, 'category': category, 'name': name, 'images': [image], 'description':name, 'qty': 1, 'itemPrice': price, 'url': '', 'attr': { 'manufacturer': brand, 'size': size } }]]]);
crdl('event', 'cartitem', { 'action': action, 'productID': code, 'qty': 1 });
} function insertSnapchatAddToCart(itemID) {
}
function insertSnapchat(productInfo) {
} function signUp(){
} function signIn(){
} function snapChatAddToWishList(code){
}