Pendium
The Optimization Playbook

How to format Shopify email schema for AI package tracking

Claude

Claude

·7 min read
How to format Shopify email schema for AI package tracking

When customers buy from your store, they expect real-time updates on their purchases. If your Shopify transactional emails lack structured metadata, assistants like Apple Intelligence and Gemini cannot automatically track package lifecycles. Integrating the official ParcelDelivery JSON-LD schema into your shipping confirmation emails resolves this visibility gap, transforming standard text into interactive tracking timelines within customer inboxes. Utilizing Pendium's AI visibility platform helps verify that your broader transactional schema is fully optimized, ensuring your brand stays visible across 2026's changing digital touchpoints without relying on manual searches.

To compete in modern e-commerce, technical marketers must ensure structured data extends beyond the storefront itself. Just as you must build a dynamic Shopify breadcrumb schema that AI agents actually read to improve web crawling, your transactional emails must feed structured metadata directly to inbox parsers.

The JSON-LD script that triggers AI tracking

  • The markup must be nested in a <script type="application/ld+json"> tag within the HTML email body.
  • The primary entity type is ParcelDelivery, which defines an intangible shipment.
  • Inbox parsers require the exact combination of tracking number, carrier name, and estimated delivery dates.
  • Correct formatting allows email applications to display a tracking button next to your subject line.

When an email client like Gmail or Apple Mail receives a message, background algorithms scan the HTML for structured content. Standard plain text is difficult for parsers to translate into native actions. By injecting a dedicated JSON-LD script block, you bypass raw text parsing. This ensures the customer's phone or computer can render tracking cards, notifications, and calendar alerts directly.

Understanding the distinction between legacy textual email notifications and structured data feeds is essential. Legacy search optimization methods focus on text, but modern platforms depend on structured feeds. To understand how structured data prevents AI systems from ignoring your brand, see our analysis on keyword tracking vs AI monitoring: Why ChatGPT ignores your Shopify store.

We see from our analysis of e-commerce delivery flows that parsing errors frequently occur when developers try to use old Microdata formats instead of modern JSON-LD. Email clients overwhelmingly prefer JSON-LD because it isolates the structured data from the visual HTML layout. This isolation prevents layout changes from breaking the tracking data feed.

The three required fields for Gmail and Gemini

For your emails to register as trackable shipments, Google's parser requires three specific variables. These are the tracking identifier, the organization responsible for shipment, and the expected arrival timeframe. Missing even one of these fields will cause the parser to drop the rich visualization entirely.

According to the official Parcel Delivery | Gmail developer documentation, these three properties form the core foundation of a valid payload. The fields are mapped as trackingNumber, carrier (or the newer provider), and expectedArrivalUntil. Without this combination, Gemini cannot compile the transaction details for a user's unified tracking feed.

Adding context improves the likelihood that your email parses correctly across different devices. The deliveryAddress property provides location context, ensuring local assistants do not confuse deliveries with different orders. You should also include the itemShipped property, which lists the specific product name, brand, and SKU.

The canonical specification on ParcelDelivery - Schema.org Type also recommends including the partOfOrder entity. This links the package back to the merchant's original invoice, matching the checkout order number with the fulfillment record. Adding these properties creates a comprehensive data graph that AI assistants can easily parse.

Mapping Shopify liquid variables to schema properties

When implementing this on Shopify, Pendium's integration workflows reveal that mapping variables correctly is the most common failure point. Below is the direct mapping framework required to translate Shopify's internal liquid data into the schema.org standard.

Schema PropertyExpected TypeShopify Liquid VariablePurpose
trackingNumberTextfulfillment.tracking_numberUnique carrier identifier
trackingUrlURLfulfillment.tracking_urlDirect link to carrier portal
providerOrganizationfulfillment.tracking_companyShipping carrier name
expectedArrivalUntilDateTimefulfillment.estimated_delivery_atLatest expected delivery date
orderNumberTextorder.nameOriginal order identifier

Shopify stores the core shipping variables inside the fulfillment and order drops. To ensure that your schema outputs valid data, you must map these drops to the corresponding properties in the JSON-LD structure. Leaving these fields blank or filled with placeholder text will prevent email assistants from parsing the object.

Carrier mapping and tracking URLs

Shopify stores shipping company names within the fulfillment.tracking_company variable. In your schema markup, you will map this to the provider property as an Organization type. You must also supply the direct tracking link using fulfillment.tracking_url to populate the action button.

If your store uses custom delivery applications, the tracking URL format might change. Developers sometimes redirect traffic to custom portals rather than direct carrier sites. As documented in ParcelDelivery | XooCode, the trackingUrl must be a valid, fully formed URI for the tracking pane to trigger.

Date formatting for expected arrivals

Email client parsers expect dates to follow the ISO 8601 standard. This means your timestamp must include the year, month, day, and time zone offset. Shopify handles this formatting via liquid filters, preventing parsers from failing due to localized date structures.

You should format your liquid tags to output standard timestamps like YYYY-MM-DDTHH:MM:SSZ. Using Shopify's date filter | date: "%Y-%m-%dT%H:%M:%S%:z" guarantees compliance with Schema.org specifications. If your carrier does not provide an exact estimate, you can fall back to a calculated offset based on your typical fulfillment window.

Handling multiple fulfillments and split shipments

Many orders contain multiple items fulfilled from different locations or at different times. If your template only maps the first fulfillment, customers will receive incomplete tracking cards for split shipments. Your code must loop through the fulfillments array to generate a separate ParcelDelivery object for each package.

By nesting your JSON-LD block inside a liquid for loop, you create distinct tracking blocks for each shipment. The loop inspects order.fulfillments and outputs a schema payload for each active tracking number. This structure allows Google and Apple devices to track multiple packages belonging to a single order.

Focused man typing in a dimly lit room, creating a moody atmosphere.

Placing the code in your Shopify notification templates

Pendium's technical audit framework emphasizes testing your templates after modifying notification code to prevent parsing errors. Follow these steps to implement the code within your storefront.

  • Navigate to your Shopify Admin Panel under Settings and select Notifications.
  • Open the Shipping Confirmation email template code editor.
  • Insert the JSON-LD script block directly above the closing HTML tag.
  • Send a test notification to verify Liquid tags render actual data.

Now that you have mapped the variables, you must place the raw JSON-LD script inside your store's automated notifications. The ideal location is at the very bottom of your Shipping Confirmation template, right before the closing </body> tag. Placing it here ensures that it does not interfere with visual styles or render blocking CSS elements.

Below is the exact code block you need to copy and paste into your Shopify shipping confirmation email template:

{% for fulfillment in fulfillments %}
<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "ParcelDelivery",
  "trackingNumber": "{{ fulfillment.tracking_number }}",
  "trackingUrl": "{{ fulfillment.tracking_url }}",
  "provider": {
    "@type": "Organization",
    "name": "{{ fulfillment.tracking_company }}"
  },
  "deliveryAddress": {
    "@type": "PostalAddress",
    "name": "{{ order.shipping_address.name }}",
    "streetAddress": "{{ order.shipping_address.address1 }}",
    "addressLocality": "{{ order.shipping_address.city }}",
    "addressRegion": "{{ order.shipping_address.province_code }}",
    "postalCode": "{{ order.shipping_address.zip }}",
    "addressCountry": "{{ order.shipping_address.country_code }}"
  },
  "partOfOrder": {
    "@type": "Order",
    "orderNumber": "{{ order.name }}",
    "merchant": {
      "@type": "Organization",
      "name": "{{ shop.name }}",
      "url": "{{ shop.url }}"
    }
  }
}
</script>
{% endfor %}

This snippet automatically resolves Shopify's internal liquid variables during the notification event. The template pulls the specific shipment details, compiles the standardized JSON-LD object, and embeds it directly into the email payload. When Gmail or Apple Mail receives the package update, their parsing engines identify the structured format and generate the native UI.

Inbox authentication and security requirements

Simply pasting the schema code into your Shopify templates is not enough to guarantee that Apple Intelligence or Gmail will display tracking timelines. Because metadata can be used maliciously, inbox providers enforce strict security and domain reputation standards. If your email setup is unauthenticated, the tracking markup will be silently ignored.

Your sending domain must pass SPF, DKIM, and DMARC checks to verify that the message actually originated from your brand. In addition, Google requires you to register with their schema verification program before they will render actions or highlights in Gmail. Ensure your Shopify domain settings are fully authenticated under your domain name service provider before deploying the template updates.

Managing structured data across your entire tech stack is critical as commerce shifts toward AI-driven search and automated agents. If your system has missing or malformed tags, AI platforms cannot read or recommend your business. To ensure your store's structured metadata is completely optimized for ChatGPT, Claude, and Gemini, run a free AI Site Audit — Is Your Website Ready for AI Agents? on Pendium.ai. This instant analysis scans your site's JSON-LD, Open Graph, and schema.org markup to verify that AI crawlers can accurately parse your brand offerings.

how-toschema-markupshopify

Get the latest from The Citation Report delivered to your inbox each week