


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);
Views
Replies
Sign in to like this content
Total Likes
@anuragc21667703 It is not clear from above snippet, how it is not clear how are you assigning Cloud Config, Segment Path and Context Hub path to your Site Page.
Please follow below tutorial for setting up Context Hub
https://experienceleague.adobe.com/docs/experience-manager-learn/sites/personalization/context-hub-t...
@anuragc21667703 It is not clear from above snippet, how it is not clear how are you assigning Cloud Config, Segment Path and Context Hub path to your Site Page.
Please follow below tutorial for setting up Context Hub
https://experienceleague.adobe.com/docs/experience-manager-learn/sites/personalization/context-hub-t...