Articles on: Onboarding / Installation

UpStackified JS Event SDK documentation

To load the non-shopify JS pixel, you can use the following snippet inserted into the <head> tag of every page


<script src='https://prod2-cdn.upstackified.com/scripts/px/ups.min.js' async='true'></script>
<script>
  window._adqLoaded =0;
  window._upsqueue = window._upsqueue || [];
  window._upstack = window._upstack || function () {
    window._upsqueue.push(arguments);
  }
  window._upstack('init', 'xxxxxxx-xxxxxx-xxxx-xxxxxxxxxxx')  // replace with your UpStackified Pixel ID
  window._upstack('page');
</script>

UpStackified PixelID can be found by logging into UpStackified and copying the following value
upstackified pixel id

All events are tracked by calling UpStackified Pixel's `_upstack('track')` function, with the event name, and (optionally) a JSON object as its parameters.

For example, here's a function call to track when a visitor has completed a purchase event, with currency and value included as a parameter:


_upstack('track', 'purchase', {currency: 'USD', value: 30.00});



Add to Cart Example:


_upstack('track', 'add_to_cart', { value: 115.00, currency: 'USD', items: [{ id: '301', price: 39.99, quantity: 1, content_type: 'product', }, { id: '401', price: 39.99, quantity: 2, content_type: 'product', }] });


List of Standard Events:

export declare enum TRACKING_EVENT_NAME { 
ADD_PAYMENT_INFO = "add_payment_info", 
ADD_SHIPPING_INFO = "add_shipping_info", 
ADD_TO_CART = "add_to_cart", 
ADD_TO_WISHLIST = "add_to_wishlist", 
COMPLETE_REGISTRATION = "complete_registration", 
CONTACT = "contact", 
INITIATE_CHECKOUT = "initiate_checkout", 
LEAD = "lead", LOGIN = "login", PAGE_VIEW = "page_view", 
PAGE_TIME = "page_time", 
PURCHASE = "purchase", 
REFUND = "refund", 
SEARCH = "search", 
START_TRIAL = "start_trial", 
SUBMIT_APPLICATION = "submit_application", 
SUBSCRIBE = "subscribe", 
SIGN_UP = "sign_up", 
VIEW_CART = "view_cart", 
VIEW_CONTENT = "view_content",
SELECT_SHIPPING_METHOD = "select_shipping_method", 
VIRTUALIZED_VIEWED_PAYMENT_FORM = "virtualized_viewd_payment_form"}


Optional Event Data Parameters:

export interface TrackingEventData { 
  [key: string]: any;
  isSyntheticWebhookEvent?: boolean;
  firstName?: string;
  lastName?: string;
  email?: string;
  phone?: string;
  addresses?: AddressInfo[];
  cartId?: string;
  transactionId?: string;
  orderId?: string;
  orderName?: string;
  affiliation?: string;
  currency?: string;
  price?: number;
  subtotalPrice?: number;
  value?: number;
  tax?: number;
  shipping?: number;
  discount?: number;
  coupon?: string;
  paymentType?: string;
  shippingTier?: string;
  creativeName?: string;
  creativeSlot?: string;
  locationId?: string;
  promotionId?: string;
  promotionName?: string;
  items?: GenericContent[];
  orderSourceName?: string;
  tags?: string[];

Updated on: 04/15/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!