I have created a segment and added script Reference configured my custom script into it.
When referring to this segment to target on a page. Script is not executing on page so targeted content doesn't change. Do we need to define something specific in the script for execution.
Script code:
ContextHub.console.log(ContextHub.Shared.timestamp(), '[loading] contexthub.getURLInfo -getURLInfo.js');
(function($) {
'use strict';
var getURLInfo = function() {
var href = ContextHub.Utils.Persistence.defaultConfig.window.location.href;
var search = ContextHub.Utils.Persistence.defaultConfig.window.location.search;
console.log('href---' + href);
return href.includes('test');
};
/* register function */
ContextHub.SegmentEngine.ScriptManager.register('getURLInfo', getURLInfo);
})(ContextHubJQ);