I am working with a client to help them implement Google Trusted Stores on their site. The code has been validated in Chrome and Firefox, but it won't in IE.
The reason is because the actual "validator" element doesn't appear. So there's no errors to see or anything to go on, it simply doesn't show up.
Google's documentation just states that if the code doesn't show up the badge code is either duplicated or missing. This is not the case however, since it doesn't even show up on a version of the site that has NO code on it but that script.
Here's the code that displays on the homepage that relates to the script:
<script type="text/javascript">
var gts = gts || [];
gts.push(["id", "STORE_ID_HERE"]); // Note: value removed for privacy
gts.push(["badge_position", "BOTTOM_LEFT"]);
gts.push(["locale", "en_US"]);
// This is a "platform hack" to support the cart they're on
// insures that the ProductID value is only transmitted on the right pages
if( $('body').hasClass('category-page-type') || $('body').hasClass('search-page') || $('body').hasClass('recommended-products-page') || $('body').hasClass('product-page-type') )
{
gts.push(["google_base_offer_id", currentProductId]); // loads variable from input on product pages
}
gts.push(["google_base_subaccount_id", "ID_HERE"]); // Also removed for privacy
gts.push(["google_base_country", "US"]);
gts.push(["google_base_language", "en"]);
(function() {
var gts = document.createElement("script");
gts.type = "text/javascript";
gts.async = true;
gts.src = "https://www.googlecommerce.com/trustedstores/api/js";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(gts, s);
})();
</script>
This code works in Firefox/Chrome, just not in IE11 (only version tested, support for 9+ is required per Google).
I also found this error (in IE11 console as well) in one of the dynamically generated files but i'm really not sure why:
Failed to open http://www.googlecommerce.com/trustedstores/s/tm2?id=17172&jsv=sDipv1xMSq4&hl=en_US&xpc={"cn"%3A"q9GW00NhHi"%2C"tp"%3Anull%2C"osh"%3Anull%2C"ppu"%3A"http%3A%2F%2Fwww.greenelectricalsupply.com%2Frobots.txt"%2C"lpu"%3A"http%3A%2F%2Fwww.googlecommerce.com%2Frobots.txt"}
The console error showed up like a cross-origin restriction, but that doesn't seem right to me for some reason.
This link causes the validator to appear: http://bit.ly/15LbcaL
You'll notice that it shows up in Chrome/Firefox, but not in IE (haven't tested 9/10, but 11 for sure doesn't work). I have actually reached out to Google, but I haven't heard back yet. Any help is appreciated.
Update
Google indicated that the problem was Window.prototype being undefined, but I'm not really confident in this answer since the validator bar (and the script in question) works fine in other browsers, just not this one.