`untranslatedTitle` is translated

For some reason the product’s untranslatedTitle in the product_viewed event is being translated as well. When firing the checkout_started event, it is showing the untranslated version.

How come that this is inconsistent? Our client specifically needs to English version of the titles instead of the translated titles.

product_viewed

{
  "productVariant": {
    "product": {
      "title": "[Testprodukt]",
      "untranslatedTitle": "[Testprodukt]", // Should be "[TEST]"
      "url": "/de-at/products/testprodukt"
    },
    "title": "S",
    "untranslatedTitle": "S"
  }
}

checkout_started

{
  "checkout": {
    "lineItems": [
      {
        "title": "[Testprodukt]",
        "variant": {
          "product": {
            "title": "[Testprodukt]",
            "untranslatedTitle": "[TEST]",
            "url": "/de-at/products/test"
          },
          "sku": "1234",
          "title": "S",
          "untranslatedTitle": "S"
        }
      }
    ],
    "localization": {
      "country": {
        "isoCode": "AT"
      },
      "language": {
        "isoCode": "de-AT"
      },
      "market": {
        "id": "gid://shopify/Market/97926152515",
        "handle": "at"
      }
    }
  }
}

The market (Austria) has German as default language and EN as second language.

Note: we don’t use en.default.json, but en-dev.default.json. We have our reasons to do this as an agency, but it might give the right context for this issue

Hey @stijn_code :waving_hand: thanks for flagging this. This does seem like potentially inconsistent behavior in how the Web Pixels API is handling the untranslatedTitle field.

Based on what you’ve shared, I suspect the issue might be related to a custom translation file naming convention.

Shopify’s translation system typically expects en.default.json as the canonical source for untranslated content (more info here), so I’m wondering if something is happening which is causing the system to misidentify which language is the “source” language in certain contexts like the product page. The checkout context appears to handle this differently, which is why you’re seeing the correct English title there. Could you test renaming your English locale file to the standard en.default.json format and see if that resolves the inconsistency? We can still look into the cause of this though, just wanted to see if this does resolve the error.

Also, can you confirm in your Shopify admin under Settings > Markets > Austria that English is configured as a language, and check what your store’s “Default language” is set to in the main language settings? If the issue persists even with standard file naming, this would likely be a something we’d need to investigate further, since I believe our the documentation mentions that the untranslatedTitle should always return the original untranslated value regardless of which event fires. Hope to hear from you soon!

Hi @Alan_G,

Thanks for the quick response!

Unfortunately changing the default language from en-dev.default.json to en.default.json doesn’t solve the issue.

I changed to our own dev store, so we’ll continue with EN and NL.

Additionally I also already opened an issue on Shopify Theme Tools for the translations as well as we run into a lot of issues with it as an agency.

Not sure for what it is worth to drop that here, but I’d like to give as much attention to it as needed.

Context: We need to have a single source of truth that is not overriding the .json files of the client. At this point, there is no such default json file we can use without the chances to override their translations.

If you need more information, please let me know :slight_smile:

Hey @stijn_code, thanks for testing that out and confirming!

That is odd that the standard naming didn’t resolve it. The documentation on our side states that this field should always return the untranslated value regardless of the active locale, but clearly something different is happening between product_viewed and checkout_started.

I’d love to dig into this a bit more and potentially escalate this internally since it does seem like unexpected behavior. Would you be able to grab some additional diagnostic info for me? First, could you log the complete event payload for both product_viewed and checkout_started (the full event object) and share those? I’m particularly curious to see if there’s any difference in the localization.language.isoCode value between the two events, and also whether the product.title field differs from product.untranslatedTitle in both cases.

Also, if possible, could you test with a really simple product that has very distinct English and Dutch titles (something like “Test English Product” vs “Test Nederlands Product”) with no variants or other complexity, just to see if the issue reproduces consistently? And one more thing to check - does the productVariant.untranslatedTitle field show the same issue in the product_viewed event, or is it just the product-level field?

I do agree that having a single source of truth for translations without overriding client data is a a good idea, so happy to advocate for this as well. Let me know what you find with those tests and I’ll dig into this further internally for you. Hope to speak soon!

Hi @Alan_G ,

Sure!

Without variants

product_viewed

{
  "productVariant": {
    "price": {
      "amount": 10,
      "currencyCode": "EUR"
    },
    "product": {
      "title": "Test Nederlands Product",
      "vendor": "CBT Dev",
      "id": "10274100805925",
      "untranslatedTitle": "Test Nederlands Product",
      "url": "/nl-nl/products/test-english-product",
      "type": ""
    },
    "id": "51668660977957",
    "image": null,
    "sku": null,
    "title": "Default Title",
    "untranslatedTitle": "Default Title"
  }
}

checkout_started

{
  "checkout": {
    "buyerAcceptsEmailMarketing": false,
    "buyerAcceptsSmsMarketing": false,
    "attributes": [],
    "billingAddress": {
      "address1": null,
      "address2": null,
      "city": null,
      "country": "NL",
      "countryCode": "NL",
      "firstName": null,
      "lastName": null,
      "phone": null,
      "province": null,
      "provinceCode": null,
      "zip": null
    },
    "token": "ea0955b7c257e0213f7ff850bd26bb67",
    "currencyCode": "EUR",
    "discountApplications": [],
    "discountsAmount": {
      "amount": 0,
      "currencyCode": "EUR"
    },
    "email": "",
    "phone": "",
    "lineItems": [
      {
        "discountAllocations": [],
        "id": "51668660977957",
        "quantity": 1,
        "title": "Test Nederlands Product",
        "variant": {
          "id": "51668660977957",
          "image": {
            "src": null
          },
          "price": {
            "amount": 10,
            "currencyCode": "EUR"
          },
          "product": {
            "id": "10274100805925",
            "title": "Test Nederlands Product",
            "vendor": "CBT Dev",
            "type": "",
            "untranslatedTitle": "Test English Product",
            "url": "/nl-nl/products/test-english-product"
          },
          "sku": null,
          "title": null,
          "untranslatedTitle": null
        },
        "finalLinePrice": {
          "amount": 10,
          "currencyCode": "EUR"
        },
        "sellingPlanAllocation": null,
        "properties": []
      }
    ],
    "localization": {
      "country": {
        "isoCode": "NL"
      },
      "language": {
        "isoCode": "nl-NL"
      },
      "market": {
        "id": "gid://shopify/Market/48424124709",
        "handle": "nl"
      }
    },
    "order": {
      "id": null,
      "customer": {
        "id": null,
        "isFirstOrder": null
      }
    },
    "delivery": {
      "selectedDeliveryOptions": []
    },
    "shippingAddress": {
      "address1": null,
      "address2": null,
      "city": null,
      "country": "NL",
      "countryCode": "NL",
      "firstName": null,
      "lastName": null,
      "phone": null,
      "province": null,
      "provinceCode": null,
      "zip": null
    },
    "subtotalPrice": {
      "amount": 10,
      "currencyCode": "EUR"
    },
    "shippingLine": {
      "price": {
        "amount": 0,
        "currencyCode": "EUR"
      }
    },
    "smsMarketingPhone": null,
    "totalTax": {
      "amount": 0,
      "currencyCode": "EUR"
    },
    "totalPrice": {
      "amount": 10,
      "currencyCode": "EUR"
    },
    "transactions": []
  }
}

With variants

Looks like variant titles are working as expected.

product_viewed

{
  "productVariant": {
    "price": {
      "amount": 10,
      "currencyCode": "EUR"
    },
    "product": {
      "title": "Test Nederlands Product",
      "vendor": "CBT Dev",
      "id": "10274100805925",
      "untranslatedTitle": "Test Nederlands Product",
      "url": "/nl-nl/products/test-english-product",
      "type": ""
    },
    "id": "51669666070821",
    "image": null,
    "sku": null,
    "title": "Klein",
    "untranslatedTitle": "Small"
  }
}

checkout_started

{
  "checkout": {
    "buyerAcceptsEmailMarketing": false,
    "buyerAcceptsSmsMarketing": false,
    "attributes": [],
    "billingAddress": {
      "address1": null,
      "address2": null,
      "city": null,
      "country": "NL",
      "countryCode": "NL",
      "firstName": null,
      "lastName": null,
      "phone": null,
      "province": null,
      "provinceCode": null,
      "zip": null
    },
    "token": "ea0955b7c257e0213f7ff850bd26bb67",
    "currencyCode": "EUR",
    "discountApplications": [],
    "discountsAmount": {
      "amount": 0,
      "currencyCode": "EUR"
    },
    "email": "",
    "phone": "",
    "lineItems": [
      {
        "discountAllocations": [],
        "id": "51669666070821",
        "quantity": 1,
        "title": "Test Nederlands Product",
        "variant": {
          "id": "51669666070821",
          "image": {
            "src": null
          },
          "price": {
            "amount": 10,
            "currencyCode": "EUR"
          },
          "product": {
            "id": "10274100805925",
            "title": "Test Nederlands Product",
            "vendor": "CBT Dev",
            "type": "",
            "untranslatedTitle": "Test English Product",
            "url": "/nl-nl/products/test-english-product"
          },
          "sku": null,
          "title": "Klein",
          "untranslatedTitle": "Small"
        },
        "finalLinePrice": {
          "amount": 10,
          "currencyCode": "EUR"
        },
        "sellingPlanAllocation": null,
        "properties": []
      }
    ],
    "localization": {
      "country": {
        "isoCode": "NL"
      },
      "language": {
        "isoCode": "nl-NL"
      },
      "market": {
        "id": "gid://shopify/Market/48424124709",
        "handle": "nl"
      }
    },
    "order": {
      "id": null,
      "customer": {
        "id": null,
        "isFirstOrder": null
      }
    },
    "delivery": {
      "selectedDeliveryOptions": []
    },
    "shippingAddress": {
      "address1": null,
      "address2": null,
      "city": null,
      "country": "NL",
      "countryCode": "NL",
      "firstName": null,
      "lastName": null,
      "phone": null,
      "province": null,
      "provinceCode": null,
      "zip": null
    },
    "subtotalPrice": {
      "amount": 10,
      "currencyCode": "EUR"
    },
    "shippingLine": {
      "price": {
        "amount": 0,
        "currencyCode": "EUR"
      }
    },
    "smsMarketingPhone": null,
    "totalTax": {
      "amount": 0,
      "currencyCode": "EUR"
    },
    "totalPrice": {
      "amount": 10,
      "currencyCode": "EUR"
    },
    "transactions": []
  }
}

Single source of thruth

Would be so great if you could like into this and maybe even prioritise this if possible. It’s already an issue for us for a really long time and we are getting more and more issues around it as well.

As an agency, you really need to have a solid solution to not override the clients content.

Thanks!

Hey @stijn_code , thanks for sharing all of that info, really helpful. The behaviour we’re seeing there is definitely a little odd. I’ll dig into this internally on our end and loop back with you once I have more info for you. Speak soon!