/* Conversion Config */
$s.currencyCode = “USD”
/* Link Tracking Config */
$s.trackDownloadLinks = true
$s.trackExternalLinks = true
$s.trackInlineStats = true
$s.linkDownloadFileTypes = “exe,zip,wav,mp3,mov,mpg,avi,wmv,pdf,doc,docx,xls,xlsx,ppt,pptx”
$s.linkInternalFilters = “javascript:,.fanatics.com,.footballfanatics.com,localhost,127.0.0.1,www.paypal.com”;
$s.linkLeaveQueryString = false
$s.linkTrackVars = “None”
$s.linkTrackEvents = “None”
/* WARNING: Changing any of the below variables will cause drastic
changes to how your visitor data is collected. Changes should only be
made when instructed to do so by your account manager.*/
$s.visitorNamespace = “fanatics”
$s.trackingServer = “fanatics.112.2o7.net”
$s.dc = “112”;
// Setup User Agent and Hostname
$s.eVar52 = $s.prop52 = navigator.userAgent;
$s.eVar54 = $s.prop54 = document.location.hostname
// The referrer of the tracking call is the current page URL.
$s.prop50 = $s.eVar50 = “D=Referer”; // “Referer” with one r is the correct spelling of this header.
// The “r” parameter in the tracking call is the referring URL.
$s.prop51 = $s.eVar51 = “D=r”;
//Setup Clickmap
function s_getObjectID(o) {
var ID = o.href;
return ID;
}
$s.getObjectID = s_getObjectID;
/* Configure Channel Manager */
$s._channelParameter = “Paid Search|pcrid”;
$s._channelPattern=”email|EML”;
/* Plugin Config */
$s.usePlugins = true
function s_doPlugins(fanatics_s_code) {
// Page view call actions
if (!$s.linkType){
// Add event30 (custom page view event) to s.events for all page view calls
$s.events = $s.apl($s.events, ‘event30’, ‘,’, 2);
}
//set current domain in linkInternalFilters
$s.getLinkInternalDomain();
// Put pageName in prop22 & eVar43 for correlation to other variables, especially in link tracking calls, which do not record pageName
if (!!$s.pageName)
$s.prop22 = $s.eVar43 = $s.pageName;
// Add calls to plugins here
// Copy search term and set aggregate search event
if ($s.prop4) {
$s.eVar1 = $s.prop4;
$s.events = $s.apl($s.events, ‘event1’, ‘,’, 2);
}
// Copy search type prop into eVar
if ($s.prop7) {
$s.eVar2 = $s.prop7;
}
// automate event27 (more than 3000 search results)
if ($s.prop5 && parseInt($s.prop5) > 3000)
$s.events = $s.apl($s.events, “event27”, “,”, 2);
// Do not refire search events if the same search term passed in twice in a row
var t_search = $s.getValOnce($s.eVar1, ‘s_stv’, 0);
if (t_search == ”) {
var a = $s.split($s.events, ‘,’);
var e = ”;
for (var i = 0; i < a.length; i++) {
if (a[i] == ‘event1’ || a[i] == ‘event2’ || a[i] == ‘event3’ || a[i] == ‘event4’)
continue;
else
e += a[i] ? a[i] + ‘,’ : a[i];
}
$s.events = e.substring(0, e.length – 1);
}
//Get Page Prior to Search
var s_prevPage = $s.getPreviousValue($s.pageName, ‘s_prevPage’, 0);
if ($s.prop4 && s_prevPage) {
$s.prop8 = s_prevPage;
}
else if ($s.prop4) {
$s.prop8 = “non-internal referrer to search results”;
}
//Get PageType Prior to Search
var s_prevPageType = $s.getPreviousValue($s.prop3, ‘s_prevProp3’, 0);
if ($s.prop4 && s_prevPageType) {
$s.prop10 = s_prevPageType;
}
else if ($s.prop4) {
$s.prop10 = “non-internal referrer to search results”;
}
// Automate Custom ProdView Event
if ($s.events && $s.events.indexOf(‘prodView’) > -1)
$s.events = $s.apl($s.events, ‘event5’, ‘,’, 2);
// Automate Finding Method eVar
var internalFlag = false;
if (document.referrer) {
var filters = $s.split($s.linkInternalFilters, ‘,’);
var docRef = $s.split(document.referrer, ‘/’);
docRef = docRef[2];
for (var f in filters) {
if (docRef.indexOf(filters[f]) > -1)
internalFlag = true;
}
}
// create productmerch product for merchandising eVar binding
if ($s.eVar6 && (!$s.products || ($s.products && $s.products.indexOf(‘;productmerch’) > -1) || $s.newProduct == ‘true’))
{
if (!$s.c_r(‘productnum’))
$s.productNum = 1;
else
$s.productNum = parseInt($s.c_r(‘productnum’)) + 1;
$s.products = ‘;productmerch’ + $s.productNum; //record an instance with orig allocation – must bind to brand new product every time
var e = new Date();
e.setTime(e.getTime() + (30 * 86400000));
$s.c_w(‘productnum’, $s.productNum, e);
if ($s.linkTrackVars == “None” || $s.linkTrackVars == ”)
$s.linkTrackVars = ‘events,products’;
else
$s.linkTrackVars = $s.apl($s.linkTrackVars, ‘events,products’, ‘,’, 2);
if ($s.linkTrackEvents == “None” || $s.linkTrackEvents == ”){
$s.linkTrackEvents = $s.events = ‘event15’;
} else {
$s.linkTrackEvents = $s.apl($s.linkTrackEvents, ‘event15’, ‘,’, 2);
$s.events = $s.apl($s.events, ‘event15’, ‘,’, 2);
}
}
if($s.products)
{
$s.events = $s.apl($s.events, ‘event15’, ‘,’, 2);
}
if ($s.c_r(‘productnum’) && $s.events.indexOf(‘purchase’) > -1)
$s.c_w(‘productnum’, ‘0’, 0);
// Automate OrderID eVar
if ($s.purchaseID)
$s.eVar21 = $s.purchaseID;
// Set Internal Campaign
if (!$s.eVar5) {
$s.eVar5 = $s.getQueryParam(‘ab’);
$s.eVar5 = $s.getValOnce($s.eVar5, ‘s_ev5’, 0);
}
// Set Campaign Variables
//TODO: Delete and write from scratch per Justice. Compare to Marketing Channels in SC Admin. Kevin Winstead at Fanatics is providing his MC logic to Justice week of 7/22.
var s_Url = window.location.href;
var s_Cpgn = parseSource(s_Url);
$s.channelManager(‘pcrid’, ‘:’, ‘c_m’, ‘0’, ‘cm_dl’, ‘1’);
if ($s._channel) {
// Correct channels based on /source/ parameter, which is in s_Cpgn
if ($s._channel == “Natural Search” && !!s_Cpgn){
$s._channel = “Paid Search”;
}
// Set Campaign Channel eVar3
if ($s._channel == “Paid Search”) {
$s.eVar3 = “ppc”;
$s.eVar6 = “Paid Search”;
}
if ($s._channel == “Natural Search”) {
$s.eVar3 = “organic search”;
}
if ($s._channel == “Other Natural Referrers”) {
$s.eVar3 = “referral”;
}
if ($s._channel == “Typed/Bookmarked”) {
$s.eVar3 = “direct”;
}
}
// Set campaign variables that won’t trigger CM
if (s_Cpgn.indexOf(’eml’) > -1) {
$s.eVar3 = “email”;
}
if (s_Cpgn.indexOf(‘callcenter’) > -1) {
$s.eVar3 = “call center”;
}
// Set s.campaign to
// Campaign Stacking
if ($s.eVar3) $s.eVar4 = $s.crossVisitParticipation($s.eVar3, ‘s_cvpcpgn’, ‘1’, ‘5’, ‘>’, ‘purchase’, 30);
//Product Finding Method Automation
if ($s.eVar6) {
//keep pre-set value
}
else if ($s.eVar3==”organic search”) {
$s.eVar6 = ‘organic search’;
}
else if ($s.campaign) {
$s.eVar6 = ‘external campaign’;
}
else if (document.referrer && !internalFlag) {
$s.eVar6 = ‘referral’;
}
else if ($s.eVar1 && $s.eVar1 != ‘non-search’) {
$s.eVar6 = ‘internal search results’;
}
else if ($s.eVar5 && $s.eVar5 != ‘non-internal campaign’) {
$s.eVar6 = ‘internal campaign’;
}
else if ($s.eVar7 && $s.eVar7 != ‘non-browse’) {
$s.eVar6 = ‘browse’;
}
else if ($s.events.indexOf(‘purchase’) > -1) {
$s.eVar6 = ‘unknown at time of purchase’;
}
//Setup Clickmap Object IDs
$s.setupDynamicObjectIDs();
// Set Partner ID Variables
if (typeof sc_PSID != ‘undefined’ && sc_PSID != ”)
$s.eVar16 = $s.prop11 = sc_PSID;
else
$s.eVar16 = $s.prop11 = window.location.hostname;
// Set Cart Created Date
if (!!$s.events && $s.events.indexOf(“scOpen”) > -1) {
var e = new Date();
$s.eVar47 = e.getMonth() + 1 + ‘/’ + e.getDate() + ‘/’ + e.getFullYear();
}
// Filter Category Stacking
if ($s.eVar23)
$s.eVar25 = $s.prop17 = $s.crossVisitParticipation($s.eVar23, ‘s_cvpva’, ‘1’, ‘5’, ‘>’, ‘purchase’, 1);
// Filter Selection Stacking
if ($s.eVar24)
$s.eVar26 = $s.prop18 = $s.crossVisitParticipation($s.eVar24, ‘s_cvpvb’, ‘1’, ‘5’, ‘>’, ‘purchase’, 1);
//Lowercase all variables
$s.manageVars(‘lowercaseVars’);
}
$s.doPlugins = s_doPlugins
/******************** CONVENIENCE FUNCTIONS *************************/
function s_setError(errorList, thePageName) {
$s.linkTrackVars = ‘pageName,prop12,prop19,prop22,prop50’;
$s.pageName = thePageName;
$s.prop12 = $s.prop19 = errorList;
$s.tl(true, ‘o’, ‘Track Error’);
}
function s_findMethod(findMethod) {
$s.linkTrackVars = ‘eVar6’;
$s.eVar6 = findMethod;
$s.tl(true, ‘o’, ‘Finding Method’);
}
function s_beginCheckout(products) {
//s_beginCheckout(‘;SKU1,;SKU2,;SKU3’)
$s.linkTrackVars = ‘eVar28,prop9,events,products’;
$s.linkTrackEvents = $s.events = ‘scCheckout’;
$s.eVar28 = ‘Checkout’;
$s.prop9 = ‘Checkout’;
$s.products = products;
$s.tl(true, ‘o’, ‘Checkout’);
}
function linkInteraction(elem,linkName) {
$s.linkTrackVars = ‘eVar28,prop9,eVar43’;
$s.eVar28 = linkName;
$s.prop9 = linkName;
if ($s.pageName) {
$s.eVar43 = $s.pageName;
}
$s.tl(elem, ‘o’, linkName, null, navigate);
return false;
}
/* Used to parse campaign code from URL */
function parseSource(pUrl) {
if (pUrl.indexOf(“/source”) > -1) {
var iEnd = pUrl.lastIndexOf(“/”) + 1;
pUrl = pUrl.substr(iEnd, pUrl.indexOf(“?”) > -1 ? pUrl.indexOf(“?”) – iEnd : pUrl.length – iEnd);
}
else pUrl = “n/a”;
return pUrl.toLowerCase();
}
/* Function to track Email sign-ups*/
function s_emailSignup(s_step, s_teams) {
if (s_step == “1”) {
$s.pageName = “email signup:choose teams”;
$s.eVar43 = “email signup:choose teams”;
$s.channel = “email signup”;
$s.prop3 = “pages”;
$s.events = “event30,event32”;
$s.t();
}
if (s_step == “2”) {
$s.pageName = “email signup:confirmation”;
$s.eVar43 = “email signup:confirmation”;
$s.channel = “email signup”;
$s.prop3 = “pages”;
$s.list1 = s_teams;
$s.events = “event30,event16”;
$s.t();
}
}
function s_haveSuggestion(productID) {
//s_haveSuggestion(‘12345’)
$s.linkTrackVars = ‘events,products’;
$s.linkTrackEvents = ‘event22’;
$s.events = ‘event22’;
if (productID)
$s.products
var s_code=”,s_objectID;function s_gi(un,pg,ss){var c=”s.version=’H.26.1′;s.an=s_an;s.logDebug=function(m){var s=this,tcf=new Function(‘var e;try{console.log(“‘+s.rep(s.rep(s.rep(m,”\”,”\”
+”\”),”n”,”\n”),”””,”\””)+’”);}catch(e){}’);tcf()};s.cls=function(x,c){var i,y=”;if(!c)c=this.an;for(i=0;i
You must be logged in to post a comment.