how to Reduce unused JavaScript in google tag and facebook and the code not in the theme

hassantanna
Tourist
13 0 1

how to Reduce unused JavaScript in google tag and facebook and the code not in the theme its through the app !Screenshot 2023-10-06 224640.png

Reply 1 (1)
SEOKart
Pathfinder
168 4 22

Hello Hassantanna,

 

Thanks for reaching out to the community!

 

Removing the unused or dead JavaScript in Google Tag and Facebook Tag depends from theme to theme. However, you can consider the most common method:

 

Go to the Shopify Admin → Select Online Store → Select Themes → Click on Actions from the dropdown button from your active theme → Click on Edit Code

Now, look in the <head> and <body> sections, where you can find the unused JavaScript, here you can modify or completely remove it.

 

However, if you’re using third-party apps for Google Tag and Facebook Tag, then you may not find the unused code on the script. 

  • Here check for the apps related to Google and Facebook Tag manager
  • Check the configuration of the apps, or consult their documentation to identify the scripts that are unused or dead

 

(If you’re unsure about the unused or dead JavaScript, consult a Shopify developer here)

 

Once identified all the unused JavaScript codes can be removed or modified on the store theme or apps. You can make use of development tools to identify unused code and remove it from your apps.

 

Hope it helps!

Leesha

SEOKart

https://apps.shopify.com/seokart