Jump to content

Recommended Posts



I'm new in prestashop, I'm triying to add a js code inside the ps_customtext module, i have somethin like this:

<!-- Google Analytics -->
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
<!-- End Google Analytics -->

<a onclick="ga('send', 'event', 'pdf', 'descargar', 'FichaTecnica');" href="link_path" target="_blank">
<img src="image_source_path" alt="Descarga Catálogo" height="192" />

but when I try to save it, I have an exeption "the property CustomText->text is not valid"


Someone can help me.




Share this post

Link to post
Share on other sites

you need add your google analytics code in head of your web page. You could do this by adding it in "themes\YOUR_THEME\templates\_partials\head.tpl" file so your tracking code would be available throughout your website. and for the anchor tag you could use ps_customtext module but you would need to turn off validation for tinymce editor because it won't allow onclick. 

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More