getVisitorData
Access Visitor and Test Information
Method Signature
getVisitorData(): VisitorDataParameters
Returns
Type
Description
Return Structure
interface VisitorData {
visitor: Visitor | null;
visitorTests: TestRelation[];
}
interface Visitor {
id: string; // Unique Shoplift visitor ID
shopifyAnalyticsId: string | null; // Shopify's analytics visitor ID
device: 'desktop' | 'mobile'; // Device type
country: string | null; // Two-letter country code (e.g., 'US', 'CA')
createdAt: Date; // First visit timestamp
storedAt: Date; // Last updated timestamp
utmSource: string; // UTM source parameter
utmMedium: string; // UTM medium parameter
utmCampaign: string; // UTM campaign parameter
utmContent: string; // UTM content parameter
referrer: string; // Referring URL
}
interface TestRelation {
testId: string; // Unique test identifier
hypothesisId: string; // Hypothesis (variant) ID
isThemeTest: boolean; // Whether this is a theme test
themeId?: number; // Shopify theme ID (if theme test)
createdAt: Date; // Assignment timestamp
isSaved: boolean; // Whether assignment is persisted
}Basic Usage
Last updated
Was this helpful?