Explain Store Speed Optimization Modifications

Topic summary

Main issue: After a “speed optimization” deployment, marketing analytics were impacted by 35%, prompting a full revert. A second expert refused to explain their changes; the requester shared before/after screenshots seeking a detailed breakdown.

Key observations from replies:

  • Changes appear to be “speed hack” tactics: modifying tag attributes to delay/disable loading, then restoring them later, and conditionally excluding scripts when the page is detected as Lighthouse/PageSpeed Insights (Google performance audit tools) to inflate scores.
  • Real-user performance may not improve; analytics/scripts can be disrupted. Obfuscated code (intentionally hard to read) manipulating the browser’s navigator object is flagged as suspect.

Guidance and cautions:

  • A step-by-step code review is beyond forum scope; use a proper diff tool or a shareable repo for review.
  • Performance should be treated as a business discipline with validation across multiple tools, not quick hacks.
  • Consider avoiding obfuscation and navigator manipulation, and scrutinize aggressive changes to script loading, especially analytics tags.
  • Hire a specialist for in-depth analysis; reference linked community threads on speed hacks and their drawbacks.

Status: Unresolved. No concrete fix provided. Screenshots are central to understanding the modifications.

Summarized with AI on February 5. AI used: gpt-5.

Hi there,

We recently hired a Shopify expert to assist us with store speed optimization and after publishing his work we noticed a 35% impact on our marketing analytics and immediately reverted his work as it was very critical for us. After that, we hired another Shopify expert to do the speed optimization from scratch but he refuses to explain his works and modifications, and scripts that he added to our store.

I was wondering if someone can explain each of the changes and modifications as shown below for us.

I would really appreciate a detailed one-by-one explanation for each part.

The block on left is BEFORE THE SPEED OPTIMIZATION and the block on right is AFTER SPEED OPTIMIZATION.

This is essentially speed hack code, see posts around this community on the nature on “Hacky” solutions to performance.

So they’re change the attributes of tags, ,so they don’t load. Then they’re loading the script tags, be fixing the attributes, UNLESS the script identifies the origin as lighthouse, so that pagespeed insights does not count the scripts towards your speed score, thus improving your speed score. Real users will probably not see any improvment in performance.

1 Like

A step by step explanation is a project in itself a question of that size way beyond the scope of a forum discussion.

Narrow the scope of questions.

And avoid widescreen screenshots like this when asking for code review it just increases friction unnecessarily for any possible contributes having to wrangle a bunch of large images. Use a diff tool with temporary publicly shareable url, or a github repo if the source licenses allow.

Roughly for analytics problems the customization is just aggressively changing every script loading behavior it can. Which includes some analytics related tools.

Not 100% in agreement with @oreoorbitz on the lighthouse dodging though yet it’s likely as the obfuscated code in the ~5th image messing with navigator is suspect.

Performance is a business discipline not something to just slap in.

To make actual long term gains from any investments It should be confirmed with testing of behavior among multiple tools in a process.

Hi there,

Thank you for your response. I agree with you, the discussion forum might not be the best option to get help regarding this topic but I am desperate for help and understanding these changes and to prevent whatever that went wrong before and impacted our advertising analytics. So please let me know where is the best place to get help regarding this detailed explanation from you or anyone that you might suggest.

Also, for “Roughly for analytics problems the customization is just aggressively changing every script loading behavior it can. Which includes some analytics related tools.” and “obfuscated code in the ~5th image messing with navigator is suspect.” what are your opinions about these exactly and if you think we should prevent them?

Thank you so much

You would want to hire someone, these forums are mainly for us to display our skills by giving a reasonable amount of help, thus leading to getting hired, or just being helpful for the sake of it, but most people aren’t going to do indepth super detailed help as that would be too time consuming.

See a community discussion on the topic of speed hack code here:
https://community.shopify.com/topic/1299055
PualNewton has a good explanation here of the possible negatives of a obfusication method, which I believe is what is being used.
Here is another thread on the topic.
https://community.shopify.com/post/1302210

1 Like