{{ content_for_header }}

Saji
Tourist
8 0 0

Hi

Will there be any issues if the code, 

{{ content_for_header }}

is replaced with 

{{ content_for_header | replace: ' ', '' | strip_newlines }} other than shopify not tracking the analytics?

As im doing it for performance reasons.

Thanks

John

0 Likes
Jason
Shopify Expert
10037 119 1873

You're assuming that the code that appears there won't run into JS issues when lines are moved (eg, non termination due to no ;).
Proceed with caution, and be aware there's potential for it to break in the future.

You can totally do it - just be quite mindful of the risk. I've done similar things - and even being a step crazier and removing it completely - here (view-source:https://freakdesign.com.au/)

Why are you doing it? If it's for reducing the size the amount saved is likely not worth the risk unless you've really gone through the site an optimised absolutely everything else. 

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

Hi Jason

I am mainly doing it for performance & speed not for reducing the size.

Saji_0-1613374648863.png

https://mobilights.com

I have tried removing it completely as you said, buy the editor does not allow me save the file, showing an error, why not for you?

Now, the code which I have mentioned to you, Already BROKE :)) . I got an error from the google console. - > 4xx error  - So I have reverted back to the old code.

My observations are that the user sessions are not recorded in shopify, i cams to know this from running google ads.

If we have shopify apps that run only offline at backend & not while the executed while the store is running for example like Newsletter apps, will commenting this code have any impact as such, what do you think?

Could you just share how you have done this?

Thanks

John

 

 

 

 

0 Likes