Random stray character on my website

New Member
5 0 0

There is a random stray "};" character located at the very top left corner of my website and I cannot figure out where it came from. I did numerous research looking into the theme.liquid and every file under the theme and even contacted Shopify to troubleshoot it and even they could not find where the stray is coming from. Can anyone please help?

0 Likes
New Member
5 0 0

  

0 Likes
Highlighted
Astronaut
1925 0 352

The culprit seems to be here:

<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/937985479/?value=1.00&amp;currency_code=USD&amp;label=EUb..."/>
</div>
</noscript>
          };
        </script>

Look through theme.liquid again and any included snippets in the header.

0 Likes
New Member
5 0 0

I cannot find that coding in the theme.liquid. do you have any other suggestions on where to look? 

0 Likes
Shopify Expert
9418 9 1258

Looking at where the character is being shown I am thinking that you've added HTML into the Additional Google Analytics Javascript section in the admin. You can only add JS in there, so the Shopify parser is likely failing since you added invalid code. It's tried to make the code valid by automatically adding a closing } character.

 

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
New Member
5 0 0

So how do I go about getting rid of it? Delete the HTML entirely?

0 Likes
Tourist
31 0 1

You could delete the analytics javascript code or post the javascript analytics code here so we can take a look for you

0 Likes
New Member
5 0 0

var LMRY = LMRY || {}, lumiary = '54d2b72f52b53f237b000014';
(function(l){
setTimeout(function(){ 
var d = document, f = d.getElementsByTagName('script')[0], s = d.createElement('script'); 
s.type = 'text/javascript'; s.async = true; s.src = l;
f.parentNode.insertBefore(s, f);
},1);})('//d3h25p0y7daqgh.cloudfront.net/lumiary.js');

ga('require', 'displayfeatures');

<!-- Google Code for Website Purchases Conversion Page -->
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 937985479;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "EUbwCJy2hGcQx4uivwM";
var google_conversion_value = 1.00;
var google_conversion_currency = "USD";
var google_remarketing_only = false;
/* ]]> */
</script>
<script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="//www.googleadservices.com/pagead/conversion/937985479/?value=1.00&amp;currency_code=USD&amp;label=EUb...
</div>
</noscript>

0 Likes
Shopify Expert
9418 9 1258

Some of those scripts seem to be more suited to the Order Status (thank you) page.
https://help.shopify.com/themes/customization/order-status/add-conversion-tracking-to-thank-you-page

Unlinke the GA scripts panel the addition scripts section for the Order Status page does allow a mix of html and javascript.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes