Skip to main content

Pre-Fill Pack Builder via URL Parameters

Create marketing links that open your Pack Builder with items already added and a specific pack size pre-selected. Perfect for ads, email campaigns, and landing pages.

Updated yesterday

Quick Reference

Parameter

What it does

Example

pack_size

Pre-selects a pack size

?pack_size=6

add_variant

Adds an item by Variant ID

?add_variant=12345678

add_product

Adds an item by product handle

?add_product=truffle-pizza


How do I pre-add a product?

Add ?add_variant=VARIANT_ID to your product URL:

https://yourstore.com/products/build-your-box?add_variant=48372615930123

Where do I find the Variant ID?

  1. Go to Shopify Admin → Products

  2. Click on the product, then the specific variant

  3. The number after /variants/ in the URL is your Variant ID

Example URL: https://admin.shopify.com/store/mystore/products/123/variants/48372615930123 → Variant ID: 48372615930123


How do I pre-add multiple products?

Add multiple add_variant parameters separated by &:

https://yourstore.com/products/build-your-box?add_variant=12345&add_variant=67890&add_variant=11111

Can I use product names instead of variant IDs?

Yes — use add_product=PRODUCT_HANDLE to add the first available variant. The handle is the URL-friendly name (e.g., yourstore.com/products/truffle-pizza → handle is truffle-pizza):

https://yourstore.com/products/build-your-box?add_product=truffle-pizza

How do I pre-select a pack size?

Add ?pack_size=NUMBER (must match an available pack size):

https://yourstore.com/products/build-your-box?pack_size=6

Can I combine parameters?

Yes — combine with &:

https://yourstore.com/products/build-your-box?pack_size=6&add_variant=12345&add_variant=67890

This opens the 6-pack with 2 items already added.


What happens when a customer clicks the link?

  1. Page loads with Pack Builder

  2. Pack size is set (if specified)

  3. Items are added to the pack

  4. URL is cleaned up (parameters removed to prevent duplicates on refresh)

  5. Customer continues building normally


Edge Cases

  • Invalid variant/product — Silently skipped; valid items still added

  • More items than pack size — Only items up to the pack limit are added; extras ignored

  • Returning customer with saved pack — URL parameters take priority over saved data


Examples

Facebook Ad for a specific flavor:

https://yourstore.com/products/build-your-box?add_variant=48372615930123

Email with 6-pack pre-selected:

https://yourstore.com/products/build-your-box?pack_size=6

Landing page with size + items pre-filled:

https://yourstore.com/products/build-your-box?pack_size=6&add_product=truffle-pizza&add_product=margherita

Troubleshooting

  • Pack size not changing — Number must match an available size exactly; use pack_size with underscore

  • Product not being added — Verify variant ID in Shopify Admin; for add_product, handle must match exactly (lowercase, hyphens)

  • Parameters not working — Use ? before first parameter, & between parameters; check for typos


Related Articles

Did this answer your question?