Shopify removes JavaScript inside <a href

Solved
Highlighted
New Member
2 0 0

Hello. On my privacy policy page I want to add this script: 

<a href="javascript&colon;window.Metomic('ConsentManager:show')">manage cookies</a>

When I hit save and go to the page it works just fine. Then when I go back to Shopify admin and reloads the page it has removed the <a> tags

Peléton_0-1604004188349.png

 

Any ideas on how to fix this?

0 Likes
Highlighted

This is an accepted solution.

You need to use onClick to execute the javascript function.

try this:

<a href="#" onclick="Metomic('ConsentManager:show')">manage cookies</a>

 let me know if it works. If yes accept my answer and give me thumbs up! thank you

⚡️ [Shopify Themes]: Lightning-fast, Highly converting, SEO-optimized, Minimal.
⚡️ Need help with your store? [Get a quote]
0 Likes
Highlighted
New Member
2 0 0

Thank you so much!

0 Likes