Skip to main content
Get the Upstack pixel running on your site in under 5 minutes. This guide covers non-Shopify installations — if you’re on Shopify, use the Shopify app installation guide instead.

Installation

Add this code snippet to every page you want to track, just before the closing </head> tag:
init alone does not send a page view — the _upstack('page') call after init is what records it.
Replace YOUR_PIXEL_ID with your actual pixel ID from the Upstack dashboard. Your pixel ID is a UUID, such as 58284d43-85f6-41fb-b2e0-f32f8ecb4e9b.

Where to Find Your Pixel ID

  1. Log in to app.upstackdata.com
  2. Open System → Events Manager
  3. Copy the Pixel ID shown in the page header (UUID format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
See How to find my Upstack Data Pixel ID for screenshots.

Where to Place the Code

Standard Websites

Place the snippet in your site’s <head> section on every page:

Single Page Applications (SPAs)

For React, Vue, Next.js, or other SPAs:
  1. Add the snippet once in your main index.html or root layout
  2. Track route changes manually (page views don’t fire automatically on navigation). The snippet already sends the first page view, so skip the initial render to avoid counting it twice.

Google Tag Manager

If you prefer GTM, create a Custom HTML tag:
  1. Create a new tag with type Custom HTML
  2. Paste the installation snippet
  3. Set trigger to All Pages (or your preferred trigger)
  4. Publish the container

Verifying Installation

Browser Console Check

Open your browser’s developer console (F12) and run:

Test a Page View

Manually fire a page view and check the Network tab:
Look for a request to upstackified.com or upstackdata.com in the Network tab.

Pixel Helper Extension

Install the Upstack Pixel Helper Chrome extension for real-time event monitoring without using the console.

Quick Start: Common Tracking Patterns

Track a Page View

Track a Product View

Track Add to Cart

Track a Purchase

Always include orderId for purchase events — Upstack derives the event ID from it to deduplicate browser and server events, so you don’t need to pass a third argument. Pass product data in items[]; destination content IDs are built from it (top-level content_ids, num_items, and content_type aren’t read).

Identifying Users

User identification improves match quality with ad platforms and enables cross-device tracking.

Basic Identification

Important: emails and phones are arrays, not single strings. This supports users with multiple contact methods.

When to Identify

Call identify() when you capture user information:
  • Newsletter signup form submission
  • Account registration
  • Checkout (when email is entered)
  • Login

Complete E-commerce Example

Here’s a full example tracking the customer journey:

Troubleshooting

Pixel Not Firing

Open Network tab in DevTools and look for ups.min.js. If it’s not loading:
  • Verify the script URL is correct
  • Check for ad blockers or privacy extensions
  • Ensure the snippet is in the <head>, not blocked by CSP
Run in console:
All should return true after the page loads.
Ensure your pixel ID:
  • Is a UUID (format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
  • Matches exactly what’s in your dashboard
  • Has no extra spaces or characters
Look for errors in the Console tab. Common issues:
  • Calling _upstack before defining the queue function
  • Syntax errors in your tracking code
  • Conflicts with other scripts

Events Not Appearing in Dashboard

Events can take a few minutes to appear in the dashboard. Check the Real-Time Events feed section of System → Events Manager for real-time data.
Look for outgoing requests after firing an event. You should see a POST request to the tracking endpoint.
Use standard event names like page_view, view_content, add_to_cart, purchase. Custom event names work but may not map to standard destination events.
The pixel automatically filters bot traffic. If you’re testing with automated tools, events may be ignored.

Common Mistakes


JavaScript SDK Reference

Full API documentation for all methods and options.

Standard Events

Reference for all standard event types and their properties.

Properties & Context

Complete reference for item arrays, customer data, and auto-captured fields.

Identity Resolution

How user identification enables cross-device tracking.

Custom Events

Create events beyond the standard taxonomy for your needs.

Connect Destinations

Send events to Meta, Google, TikTok, Klaviyo, and more.