Our Transaction ID variable is different or not working

Help, me check and/fix is our Transaction ID variable is different or not working.

This what the line in question is suppose to look like (according to our external marketing team):

transaction_id: event.data?.checkout?.order?

Our external marketing team pushed some values in datalayer in Shopify/Customer Events.
They used the same code that works for all their other shopify customers. Everything besides transaction id works. They tell us to check if we are using a different variable or if it might not be working.

I have been in contact with shopify support that sent me to the community forum, where developers would helps you to located/fix the issue.

Use the Correct Shopify Liquid Variables:

Shopify provides specific Liquid variables to capture transaction details. For the transaction ID, it’s recommended to use:

  • Order ID: {{ order.id }}
  • Order Name (with # prefix): {{ order.name }}

Also, go through this Shopify Community answer.

Implement Google Tag Manager (GTM) for Enhanced Tracking:

GTM offers a robust solution for managing tracking scripts and preventing issues like duplicate event firing. Here’s how you can set it up:

  • Data Layer Configuration: Ensure that your Shopify store’s data layer is correctly configured to push transaction data. This includes details like transaction ID, value, currency, and items. Refer to a Shopify community answer related to this.

  • GTM Tag Setup: In GTM, create tags that listen for purchase events and push the relevant data to Google Ads or other platforms.

  • Prevent Duplicate Tracking: To avoid counting the same transaction multiple times, implement checks using GTM’s first_time_accessed variable or set flags in the browser’s localStorage. This ensures that purchase events are recorded only once per transaction.

Utilize Shopify’s Customer Events for Checkout Tracking:

With Shopify’s Checkout 2.0, tracking checkout events requires subscribing to customer events. You can add custom scripts to listen for events like checkout_completed, checkout_updated, and checkout_started, and push these events to your tracking platforms.

Verify and Test Your Tracking Implementation:

  • This allows you to see which tags fire on your site and debug any issues.

  • Ensure that purchase events are not counted multiple times, which can skew your analytics and ad performance data.

  • Verify that transactions are recorded correctly in your advertising platforms.