How to Display Your Environmental Impact with GoodAPI Metafields
If your brand is committed to sustainability, you can automatically display your real-time environmental impact across your Shopify store using GoodAPI metafields. These metafields update automatically and can be surfaced anywhere on your store — from your homepage to order confirmation emails.
The GoodAPI Metafields
Section titled “The GoodAPI Metafields”GoodAPI provides four shop-level metafields that update automatically as your impact grows:
goodapi.total_number_trees— The total number of trees pledged on behalf of your customersgoodapi.total_number_kelp— The total number of kelp fronds pledgedgoodapi.total_number_bottles— The total number of ocean-bound plastic bottles collectedgoodapi.total_pounds_plastic_removed— The total pounds of plastic removed (calculated as bottles / 22)
Step 1: Create Metafield Definitions
Section titled “Step 1: Create Metafield Definitions”Before you can use these metafields in your theme, you need to create a definition for each one.
- From your Shopify admin, go to Settings > Metafields > Shop > Unstructured Metafields
- Find the unstructured metafield (e.g.
goodapi.total_number_trees) and click on it to create a definition - Give it a clear name (e.g. “Trees Pledged”), set the type to Integer, and save
- Repeat for
total_number_kelp,total_number_bottles, andtotal_pounds_plastic_removedOnce definitions are created, these metafields become available as dynamic sources throughout your theme editor — no coding required.
Step 2: Display on Your Online Store
Section titled “Step 2: Display on Your Online Store”You can add your impact numbers to any page — homepage, product pages, about page, etc.
- Go to Online Store > Themes and click Customize
- Navigate to the page or template you want to edit
- Add or select a text block/section
- Click the Connect dynamic source icon (🔗) next to the text field
- Search for and select the metafield (e.g. “Trees Pledged”)
- Save your changes Pro tip: Consider adding an impact counter section to your homepage or a dedicated sustainability page to showcase all four metrics together.
Step 3: Include Impact in Order Confirmation Emails
Section titled “Step 3: Include Impact in Order Confirmation Emails”Showing customers their personal contribution at the moment of purchase is a powerful trust-builder.
- Go to Settings > Notifications and select Order confirmation
- Click Edit code
- Add the following Liquid snippet where you’d like the impact to appear:
<p>Thanks to your order, we've contributed to:</p><ul> <li>🌳 {{ shop.metafields.goodapi.total_number_trees }} trees planted</li> <li>🌿 {{ shop.metafields.goodapi.total_number_kelp }} kelp fronds restored</li> <li>♻️ {{ shop.metafields.goodapi.total_number_bottles }} ocean-bound plastic bottles collected</li> <li>⚖️ {{ shop.metafields.goodapi.total_pounds_plastic_removed }} pounds of plastic removed</li></ul>Step 4: Other Places to Use These Metafields
Section titled “Step 4: Other Places to Use These Metafields”| Location | How to Use |
|---|---|
| Homepage banner | Connect as dynamic source in theme editor |
| Product pages | Add a sustainability block using dynamic sources |
| Footer | Add a text block with dynamic source connected |
| Packing slips | Add Liquid snippet to the packing slip template in Notifications |
| Abandoned cart emails | Remind customers of their potential impact to encourage completion |
| Thank you / Order status page | Add via Settings > Checkout > Order status page additional scripts |
Tips for Maximizing Impact
Section titled “Tips for Maximizing Impact”- Keep it prominent — Place your impact metrics above the fold on your homepage so visitors see them immediately.
- Use compelling copy — Pair the numbers with context, e.g. “Together, we’ve planted 13,000+ trees!”
- Update your marketing — Reference these live numbers in social media captions and email campaigns by pulling the current values.
- Celebrate milestones — Set up a Shopify Flow automation to notify your team when key thresholds are hit (e.g. every 1,000 trees).
This is a great way to build trust and turn your sustainability commitment into a visible, living part of your brand story!