Initialize the Evergage system.
Evergage.init();
Reinitialize Evergage for SPAs after navigation.
Evergage.reinit();
Initialize SmartVar content areas manually.
Evergage.initSmartVar();
Reinitialize SmartVar areas in SPAs.
Evergage.reinitSmartVar();
Force display of SmartVar content immediately.
Evergage.displaySmartVar();
Retrieve campaign responses from this page view.
const responses = Evergage.getCampaignResponses();
Send a beacon immediately to the server with collected data.
Evergage.sendBeacon();
Track a custom user action.
Evergage.trackAction("ProductClicked", { productId: "sku123" });
Manually track a page view, typically in SPAs.
Evergage.trackPageView("Checkout", { step: "2" });
Push a custom event into the Evergage event queue.
Evergage.pushEvent({ name: "FormSubmitted", attributes: { formName: "NewsletterSignup" } });
Previously used for SmartContent rendering manually.
Evergage.smartContentRenderer()
Old method to initialize sitemap structure for campaigns.
Evergage.initSitemap()
Old method to reinitialize sitemap after SPA change.
Evergage.reinitSitemap()
Retrieve sitemap object.
Evergage.getSitemap()
Manually set sitemap (very old technique).
Evergage.setSitemap()
Hide SmartContent manually.
Reset SmartContent state.
Evergage.resetSmartContent()
Reinitialize SalesforceInteractions for SPAs.
SalesforceInteractions.reinit();
Send a custom interaction event.
SalesforceInteractions.sendEvent({ action: "AddedToCart", attributes: { productId: "sku123", quantity: 2 } });
Apply context data dynamically for personalization.
SalesforceInteractions.applyContext({ user: { email: "john@example.com", loyaltyStatus: "Gold" } });
Set or update user identity information.
SalesforceInteractions.setIdentity({ userId: "user-123", attributes: { email: "user@example.com", phone: "1234567890" } });
Reset user session to anonymous.
SalesforceInteractions.anonymous();
Update cart information (used for Cart Abandonment campaigns).
SalesforceInteractions.updateCart({ items: [ { id: "sku123", quantity: 1 }, { id: "sku456", quantity: 2 } ], total: 149.99 });
Clear the cart context from personalization.
SalesforceInteractions.clearCart();
Send a page load event manually if needed.
SalesforceInteractions.trackPageLoad({ pageType: "HomePage", campaign: "SummerSale" });
Older command, now merged with trackPageLoad().
SalesforceInteractions.sendPageView()
Older form of sending a custom event (now sendEvent).
SalesforceInteractions.sendInteraction()
Old profile update, replaced by applyContext().
SalesforceInteractions.updateProfile()
Old method to reset user profile.
SalesforceInteractions.clearProfile()