How to Assign a Value/Price to an Event
Assigning values to your events helps Meta optimize ad delivery and measure ROI. PixelFlow lets you attach prices and values to events like Purchase, Lead, and AddToCart through multiple methods depending on your setup.
Before you begin: Make sure you've installed the PixelFlow script and set up basic event tracking. Values work with Purchase, AddToCart, InitiateCheckout, Lead, ViewContent, and CompleteRegistration events.
Set Your Default Currency
Start by configuring your site-wide currency in the PixelFlow dashboard:
Go to Dashboard → Sites
Click Edit on your site or Add Site for new sites
Enter your currency code (e.g., USD, EUR, GBP) in the currency field
Click Save
This currency applies to all events unless you override it per event using the methods below.
Method 1: Extract Values from URL Parameters
Best for thank-you pages or order confirmations where the price appears in the URL (e.g., /thank-you?total=99.99).
In your dashboard, go to Sites and click Edit on your site
Click Add URL or edit an existing URL pattern
Paste your URL pattern (e.g.,
/order-confirmation)Select your event type (e.g., Purchase)
Toggle on "Extract data from URL parameters?"
In the mapping dropdown, select your URL parameter name (e.g.,
priceortotal) and map it to valueClick Save
If your URL includes ?price=99.99¤cy=EUR, you can map both parameters—one to "value" and one to "currency" to override the site default.
PixelFlow will automatically extract the value when the page loads and include it in the event payload sent to Meta.
Method 2: Use CSS Classes on Form Fields
Ideal for checkout forms or lead forms where users enter a price or value.
Add the CSS class info-val-pf to any input field containing the value:
<input type="text" class="info-val-pf" value="99.99"> When the event fires (e.g., on form submission), PixelFlow reads the field value and attaches it to the event.
To override currency per field, use info-currency-pf:
<input type="hidden" class="info-currency-pf" value="GBP"> Method 3: Enable Auto-Extract for E-commerce
For Webflow or Squarespace sites with native e-commerce, PixelFlow can automatically pull values from your cart and checkout pages.
Go to Dashboard → Sites → Edit
Scroll to Advanced Setup → E-commerce
Toggle on Auto-extract for Purchase or InitiateCheckout events
Click Save
PixelFlow will detect product prices, cart totals, and currency from your e-commerce platform's data layer.
Method 4: Track Values with the JavaScript API
For complete control or custom flows (e.g., dynamic pricing, subscriptions), use the PixelFlow JavaScript API:
window.pixelFlow.trackEvent("Purchase", {
value: 99.99,
currency: "USD",
contents: [
{ id: "prod_123", quantity: 1, item_price: 99.99 }
],
num_items: 1
}, {
em: "[email protected]",
fn: "Jane",
ln: "Doe"
}); This method works on any page or trigger (button clicks, AJAX completions, etc.). Learn more in the Programmatic Tracking API guide.
Make sure window.pixelFlow is available before calling trackEvent. Wrap your code in a check or wait for the script to load.
Method 5: Custom JavaScript Extraction
For platforms like ClickFunnels or custom checkouts, write a script to extract the value from your page's data layer or DOM:
<script>
(function () {
// Example: Extract order total from localStorage
var checkoutData = JSON.parse(localStorage.getItem("cf_checkout_details"));
var orderTotal = checkoutData ? checkoutData.products_total_price : 0;
// Track Purchase event with extracted value
window.pixelFlow.trackEvent("Purchase", {
value: orderTotal,
currency: "USD"
});
})();
</script> Place this script on your confirmation page after the PixelFlow script loads.
Verify Values in Meta Events Manager
After setting up values, check that they're being sent correctly:
Open Meta Events Manager and select your pixel
Go to Test Events
Complete a test transaction or form submission on your site
Look for your event in the Test Events feed
Expand the event and confirm value and currency appear in the parameters
Events with accurate values improve your Event Match Quality score and help Meta optimize for conversions with similar transaction sizes.
Which Method Should You Use?
URL parameters: Best for simple thank-you pages with prices in the URL
CSS classes: Perfect for lead forms or single-product checkouts
Auto-extract: Easiest for Webflow/Squarespace e-commerce sites
JavaScript API: Required for custom flows, dynamic pricing, or events not tied to page loads
Custom scripts: Use when your platform stores order data in a proprietary format
For more details on event parameters, see Event Specific Parameters and Introduction to Event Parameters.