This file contains 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(){window.optimizelyMoat=window.optimizelyMoat||[],window.optimizely=window.optimizely||[];var a=function(a){for(var f,h,b=a.data.campaign,c=b.name,d=a.data.decision.isCampaignHoldback?"holdback":"treatment",e=a.data.decision.experimentId,g=a.data.decision.variationId,i=0;i<b.experiments.length;i++)e===b.experiments[i].id&&(f=null==b.experiments[i].name?b.experiments[i].audienceName:b.experiments[i].name,experienceIndex=i);for(var j=0;j<b.experiments[experienceIndex].variations.length;j++)g===b.experiments[experienceIndex].variations[j].id&&(h=b.experiments[experienceIndex].variations[j].name);if("equal_priority"===b.policy)var k=c+":"+f+":"+h+":"+d;else{if(redirect_campaign[key].isCampaignHoldback)return;var k=f+":"+h}window.optimizelyMoat.push(k),console.log("Moat pushed",k)};window.optimizely.push({type:"addListener",filter:{type:"lifecycle",name:"campaignDecided"},handler:a});var b=function(){var a=optimizely.get("state");if(null!=a.getRedirectInfo()){var b=a.getCampaignStates({visitorRedirected: |
This file contains 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
var state = optimizely.get('state'); | |
var string = state.getDecisionString({"campaignId":campaignId}); | |
if (string) { | |
window.optimizelyMoat = window.optimizelyMoat || []; | |
window.optimizelyMoat.push(string); | |
} |
This file contains 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
/*define handler function to be executed when each campaign is decided as the page loads. | |
From that event.data object, pull in Experiment Name: variation Name for A/B Tests, Campaign:experiment:Variation:Holdback/treatment for Campaigns | |
Then push values as strings to optimizelyMoat array*/ | |
var campaignDecided = function(event) { | |
var campaign = event.data.campaign; | |
var campaignName = campaign.name; | |
var holdback = (event.data.decision.isCampaignHoldback ? "holdback" : "treatment"); | |
var experienceId = event.data.decision.experimentId; | |
var experienceName; | |
var variationId = event.data.decision.variationId; |
This file contains 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
var utils = window.optimizely.get('utils'); | |
var cityDropdownText = '.styledComboBox label:first'; | |
var selectedCity = '#SelectedCityId option:contains(' + extension.default_city + ')'; | |
var heroImage = '.imageRotatorImg'; | |
var headline = '.imageRotatorText'; | |
var subtext = '.MediumHeroText'; | |
var headlineLeftPos = extension.HL_LR + 'px'; | |
var headlineTopPos = extension.HL_UD + 'px'; | |
var subtextLeftPos = extension.ST_LR + 'px'; | |
var suntextTopPos = extension.ST_UD + 'px'; |
This file contains 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
//Define Function to get jQuery and bind events after Optimizely is initialized | |
var bindEvents = function(){ | |
var $ = optimizely.get('jquery'); | |
$(document).ready(function() { | |
console.log('Dom Ready'); | |
if (window.location.href === 'http://www.relatedrentals.com/' || window.location.href === 'http://www.relatedrentals.com/apartment-rentals/apartment-search') { | |
//Bind to the submission on the two forms | |
console.log('URL Match'); | |
$('#SearchAptBasicForm,#SearchAptForm').bind('submit', function() { | |
console.log('Form Submit'); |