\`\`\`javascript
// WIX Customer Intelligence Agent (CIA) Tracking Script
// CIA Base URL: https://cjscottiii.pythonanywhere.com
const CIA_BASE_URL = "https://cjscottiii.pythonanywhere.com";
/**
* Generates a simple unique ID (UUID v4-like)
* @returns {string} A unique ID string
*/
function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
/**
* Retrieves the customer ID from localStorage or creates a new one.
* @returns {string} The unique customer ID.
*/
function getOrCreateCustomerId() {
let customerId = localStorage.getItem('cia_customer_id');
if (!customerId) {
customerId = generateUUID();
localStorage.setItem('cia_customer_id', customerId);
console.log("CIA: New customer ID created:", customerId);
} else {
console.log("CIA: Existing customer ID retrieved:", customerId);
}
return customerId;
}
/**
* Sends a page view tracking event to the CIA backend.
* @param {string} customerId - The unique ID of the customer.
*/
function trackPageView(customerId) {
const trackUrl = \`\${CIA_BASE_URL}/api/v1/track\`;
const data = {
customer_id: customerId,
page_url: window.location.href,
event_type: 'page_view'
};
fetch(trackUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => {
console.log('CIA Tracking Success:', data);
})
.catch((error) => {
console.error('CIA Tracking Error:', error);
});
}
/**
* Fetches a personalized recommendation from the CIA backend.
* @param {string} customerId - The unique ID of the customer.
*/
function fetchRecommendation(customerId) {
const recommendationUrl = \`\${CIA_BASE_URL}/api/v1/recommendation/\${customerId}\`;
fetch(recommendationUrl)
.then(response => response.json())
.then(data => {
console.log('CIA Recommendation:', data.recommendation);
// This is the key output. In a future step, you will use Wix Velo/Corvid
// to capture this recommendation and display it to the user on the page.
// For now, check your browser's console (F12) to confirm it is working.
})
.catch((error) => {
console.error('CIA Recommendation Error:', error);
});
}
// Main execution block
(function() {
const customerId = getOrCreateCustomerId();
trackPageView(customerId);
fetchRecommendation(customerId);
})();
\`\`\`
top of page
BE WELL: IMMUNITEA TEA & HONEY GIFT PACKAn elegant gift for Tea lovers & honey connoisseurs, immune-boosting properties perfect for a nice gift to your love ones, Family, Friends & not to forget clients or co-workers,Gift Pack includes: ▪️Organic Soursop Leaf Tea bags▪️Organic Raw Honey SticksIngredients: All Natural Soursop - Naturally grown, hand-harvested, and air-dried from Jamaica 🇯🇲 .Free from pesticides and residuals.Non-gmo product.Some of the great health Benefits Of SASALAPA aka SOURSOP are:▪️ANTIOXIDANTS▪️HELPS KILL CANCER CELLS▪️HELPS FIGHT BACTERIA▪️BOOSTS IMMUNITY▪️IMPROVES GASTROINTESTINAL HEALTH▪️MAY HELP STABILIZE BLOOD PRESSURE & SUGAR LEVELORGANIC RAW HONEY STICKS:100% Pure Star Thistle honey, packed 5 grams per stick. Delicious treats for people of all ages & An all-natural candy.Honey Sticks are a great way to enjoy a taste of honey anytime and anywhere! Kids really enjoy natural sweet honey as a treat instead of sugar.