Can't add 'line_item' property from 'checkout' object to dataLayer on the Order Status page

Topic summary

A developer is attempting to access the selling_plan_name property from checkout.line_items[0] and push it to the dataLayer on Shopify’s Order Status page, but the value returns blank despite being visible in the console.

Key Issue:

  • The property checkout.line_items[0].selling_plan_name exists and is accessible via browser console
  • When referenced in the Order Status Page > Additional Scripts section, it fails to populate in the dataLayer
  • The developer has confirmed the dataLayer script is functioning for other line_item properties

Goal:

  • Initially trying to retrieve a single value to troubleshoot
  • Ultimate objective is to iterate through all purchased items and push selling plan names to the dataLayer as an array

Attached Resources:

  • Screenshot showing the property exists in the checkout object
  • Code snippet of the current dataLayer implementation (appears corrupted/encoded in the post)

The discussion remains open with no responses or solutions provided yet.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

Hi there!

I’m trying to get the value of a checkout object property to get pushed to the dataLayer on the Order Status page after a purchase. But for some reason I can’t seem to access it.

The image attached shows that the ‘selling_plan_name’ property exists in checkout.line_items[0].selling_plan_name.

But when calling that directly in Order Status Page>Additional scripts I can’t get it to show in the dataLayer.

Ideally, I’ll be able to iterate through the purchased items and push to the DL in an array, but first just trying to figure out why this can’t be picked up.

Also, here’s the dataLayer script I’m using.

subscriptionStatus is this new property I’m trying to call by following the same format as the others in the line_items loop:

{% comment %} Purchase data layer v2.1 - part of "Shopify GA4 Kit" by Analyzify
Visit https://analyzify.app/shopify-google-analytics/ga4 for complete tutorial 
{% endcomment %}

{% assign template_name = template.name %}

No matter what I try the array comes back blank in the dataLayer.

If it’s available via the console, what’s stopping me from being able to pull that value?

Any help would be much appreciated!