Add the search box to your site

It takes about two minutes. Pick your platform below. Your shoppers never leave your site: the box sits on your own page and searches every member shop.

Pick your platform

Shopify WooCommerce (WordPress) Squarespace Wix BigCommerce Etsy Custom website, WaSQL or anything else

Sign in to your member portal and these snippets fill in your shop name and key automatically. Until then, replace yourshop.com and YOUR_SHOP_KEY.

How it works on every platform

  1. Add the script to every page of your site (so referral clicks are remembered).
  2. Add the search box (a one-line div) on the page where you want it.
  3. Your products are read from the product markup your store already has. Check or refill them from your portal with "Re-read my site now".
  4. Optional but important: add sale tracking to your order-confirmation page. Shops that send you a sale only get credited if your confirmation page reports it.

Menus and plan names change. If a step does not match what you see, check your platform's help pages, or send us a screenshot and we will help.

Shopify Easy

Any plan. Editing theme code is available on every plan.

Add the search box

  1. In Shopify admin go to Online Store > Themes. Next to your live theme click the three dots > Duplicate (a safety copy), then on the live theme click the three dots > Edit code.
  2. Open layout/theme.liquid. Just before the closing </body> tag, paste the script tag below. Save.
  3. Go to Online Store > Pages > Add page. Name it something like "Search all print shops". In the page editor click the <> (Show HTML) button and paste the div below. Save.
  4. Add the page to your menu: Online Store > Navigation > Main menu > Add menu item.
  5. Prefer the theme editor? Online Store > Themes > Customize, add a "Custom Liquid" section where you want the box, and paste the div.
Script (paste in theme.liquid)
<script src="https://3dprintster.us/3dprintster.js" data-shop="yourshop.com" data-key="YOUR_SHOP_KEY" data-button="off" async></script>
Search box (paste on your search page)
<div id="3dprintster"></div>
Customer events pixel (tracking)
analytics.subscribe("checkout_completed", async (event) => { const checkout = event.data.checkout; const click = await browser.cookie.get("p3d"); // set by the 3DPrintster script when a shopper arrives from a search if (!click) { return; } const items = checkout.lineItems.map((li) => ({ sku: li.variant && li.variant.sku, price: li.variant && li.variant.price && li.variant.price.amount, qty: li.quantity })); const body = new URLSearchParams({ shop: "yourshop.com", key: "YOUR_SHOP_KEY", p3d: click, order: String(checkout.order && checkout.order.id || checkout.token), items: JSON.stringify(items) }); fetch("https://3dprintster.us/api/convert", { method: "POST", body: body, keepalive: true }); });

Track sales (so referral fees are credited)

Tracking lets shops that send you a sale be credited, and lets you be credited when you send one. Shopify moved checkout tracking to "Customer events", so this uses a custom pixel. Treat it as best effort and test it with a real order - Shopify changes this area often.

  1. Go to Settings > Customer events > Add custom pixel. Name it "3DPrintster".
  2. Paste the pixel code below and click Save, then Connect.
  3. Place a test order, then tell us the order number and we will confirm it arrived.

Good to know

WooCommerce (WordPress) Easy

Any WordPress site. A free code-snippets plugin makes it painless.

Add the search box

  1. Install the free WPCode plugin (Plugins > Add New > search "WPCode"). You can instead paste into your theme header/footer, but a plugin survives theme updates.
  2. Go to Code Snippets > Add Snippet > "Add Your Custom Code (New Snippet)". Choose HTML Snippet, paste the script tag below, set Location to "Site Wide Footer", turn it Active and Save.
  3. Go to Pages > Add New. Add a "Custom HTML" block and paste the div below. Publish, then add the page to your menu (Appearance > Menus).
Script (Site Wide Footer)
<script src="https://3dprintster.us/3dprintster.js" data-shop="yourshop.com" data-key="YOUR_SHOP_KEY" data-button="off" async></script>
Search box (Custom HTML block)
<div id="3dprintster"></div>
PHP snippet (tracking)
add_action('woocommerce_thankyou', function($order_id){ $order = wc_get_order($order_id); if(!$order){ return; } $items = array(); foreach($order->get_items() as $item){ $product = $item->get_product(); $items[] = array( 'sku' => $product ? $product->get_sku() : '', 'price' => round((float)$order->get_item_subtotal($item, false, false), 2), 'qty' => (int)$item->get_quantity(), ); } $data = array('order' => (string)$order->get_order_number(), 'items' => $items); echo '<script>window.addEventListener("load",function(){ if(window.p3d){ p3d.convert(' . wp_json_encode($data) . '); } });</script>'; });

Track sales (so referral fees are credited)

Add a small PHP snippet that runs on the order-confirmation page. It sends only the order number, SKUs and prices.

  1. In WPCode create another snippet, choose "PHP Snippet", and paste the code below.
  2. Make sure every product has a SKU (Products > edit > Inventory). Referral credit matches on SKU.
  3. Set it Active and place a test order.

Good to know

Squarespace Medium

Needs a plan that allows custom code (Business or higher). Check Squarespace for current plan details.

Add the search box

  1. Go to Settings > Developer Tools > Code Injection (the exact menu name can differ by version) and paste the script tag below into the Footer box. Save.
  2. Edit the page where you want the search box. Click an insert point, choose a Code block, paste the div below, and turn off "Display Source". Save.
Script (Code Injection > Footer)
<script src="https://3dprintster.us/3dprintster.js" data-shop="yourshop.com" data-key="YOUR_SHOP_KEY" data-button="off" async></script>
Search box (Code block)
<div id="3dprintster"></div>

Track sales (so referral fees are credited)

Squarespace does not give order-confirmation code access to the per-item SKUs we need, so automatic sale tracking is not supported yet. Searching and being found work normally.

Good to know

Wix Medium

Needs a Premium plan with a connected domain to add custom code. Check Wix for current plan details.

Add the search box

  1. Simplest: open the editor, choose Add Elements > Embed Code > Embed HTML, pick "Code", and paste BOTH snippets below together. Resize the box to fit.
  2. The embed runs in its own frame, so it needs the shop name and key exactly as shown in the script tag.
  3. To track referral clicks on every page instead, go to Settings > Custom code > Add Custom Code, paste the script, choose All pages, and place it in Body - end.
Paste both together in an Embed HTML element
<script src="https://3dprintster.us/3dprintster.js" data-shop="yourshop.com" data-key="YOUR_SHOP_KEY" data-button="off" async></script> <div id="3dprintster"></div>

Track sales (so referral fees are credited)

Wix does not expose the per-item SKUs we need on the thank-you page, so automatic sale tracking is not supported yet.

Good to know

BigCommerce Medium

Any plan; Script Manager is in the control panel.

Add the search box

  1. Go to Storefront > Script Manager > Create a Script. Name it "3DPrintster", location "Footer", pages "All pages", script type "Script", and paste the script tag below. Save.
  2. Go to Storefront > Web Pages > Create a Web Page, switch the editor to HTML (the <> button), and paste the div below. Publish and add it to your menu.
Script (Script Manager)
<script src="https://3dprintster.us/3dprintster.js" data-shop="yourshop.com" data-key="YOUR_SHOP_KEY" data-button="off" async></script>
Search box (Web Page HTML)
<div id="3dprintster"></div>

Track sales (so referral fees are credited)

Order data on the confirmation page needs the Storefront API and custom code, so automatic sale tracking is an advanced setup. Use the server postback in the "Custom website" guide, or contact us and we will help.

Good to know

Etsy Not supported

Etsy does not allow custom scripts on your shop page, and it blocks crawlers.

Add the search box

  1. You cannot add the search box to an Etsy shop, and we cannot read Etsy listings automatically.
  2. If you also run your own website (even a simple one), join with that site: it can hold the search box and your products.

Custom website, WaSQL or anything else Easy

Anything that lets you edit the page HTML.

Add the search box

  1. Paste the script tag in your site template just before the closing </body> tag so it loads on every page.
  2. Paste the div on the page where the search box should appear. Keep the id exactly "3dprintster".
  3. On WaSQL, put the script in your template body (or minify it with your bundle) and the div in the page body.
Script (every page)
<script src="https://3dprintster.us/3dprintster.js" data-shop="yourshop.com" data-key="YOUR_SHOP_KEY" data-button="off" async></script>
Search box (one page)
<div id="3dprintster"></div>
Confirmation snippet (browser tracking)
<script> window.addEventListener('load',function(){ if(window.p3d){ p3d.convert({order:'ORDER_NUMBER', items:[{sku:'SKU', price:1.25, qty:1}]}); } }); </script>
Server postback
curl -X POST https://3dprintster.us/api/convert \ -d shop=yourshop.com -d api_key=YOUR_API_KEY \ -d p3d=CLICK_ID -d order=1042 \ --data-urlencode 'items=[{"sku":"FIT-4WAY","price":1.25,"qty":2}]'

Track sales (so referral fees are credited)

Two options. In the browser, add the snippet to your order-confirmation page. Or call our API from your server when an order is paid, which cannot be blocked by ad blockers.

  1. Browser: paste the confirmation snippet below on the order-confirmation page and fill in the order number and items.
  2. Server: when a shopper arrives from a search, our link adds ?p3d=NUMBER. Save that number with the visit or cart, then send it with the order using the postback below. Your secret api_key is on your portal - keep it out of any page.

Good to know

Check that it works

  1. Open the page with the search box and search for one of your own products. It should appear first, marked as yours.
  2. In your portal click "Re-read my site now" and check the product count. Zero means we could not find product markup: upload a CSV instead.
  3. Search for a product another shop sells and click it. You should land on that shop's own product page.

Need help? Email steve.lloyd@gmail.com.