Help adding affiliate pixel code

Topic summary

  • Goal: Pass the Shopify order name (same as the customer-facing order ID) into an affiliate tracking pixel.
  • Attempt: Inserted the Liquid variable {{order.name}} in the pixel code.
  • Issue: Testing returns a JavaScript error — “ReferenceError: order is not defined”.
  • Efforts: Multiple troubleshooting steps tried without success (details not provided).
  • Status: No resolution or workaround shared; the question remains open.
Summarized with AI on December 16. AI used: gpt-5.

I want to get order name to be pushed in my affiliate tracking pixel. basically, same order ID as the one that end customer gets. In the pixel I have added, I have added variable to get this as {{order.name}} however on testing I keep getting error like below. I have tried lots of troubleshooting steps but nothing seems to be working.

“ReferenceError: order is not defined”