This user has no favorite topics.
Favorite Forum Topics
Forum Topics Created
Status |
Topic
|
Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Tracking code on our forms works on English site BUT NOT translated site
Started by: dagobertoR
in: English Support
Problem: Solution: 1. Refer to our documentation on how to use the "wpml_current_language" hook: https://wpml.org/wpml-hook/wpml_current_language/ 2. Add the following PHP code snippet to the functions.php file of your theme: $my_current_lang = apply_filters( 'wpml_current_language', NULL );<br /><br />if($my_current_lang=='es-ES'){<br />//Here goes the tracking code.<br />} 3. Ensure that you use "echo" to output the JavaScript code within the PHP "if" statement, like this: $my_current_lang = apply_filters( 'wpml_current_language', NULL );<br /><br />if ($my_current_lang == 'es-ES') {<br /> echo '<script>"use strict";var simplyconvert_hash = "5bde78b7cdb60170c883efdd3ee8cde9";<br /> !function() {var e = 3e5, n = Math.ceil(new Date() / e) * e, o = document.createElement("script");<br /> o.id = "_scloader", o.type = "text/javascript", o.async = !0, o.src = "//simplyconvert.com/app/embed/"+n+"/load.js";<br /> var i = document.getElementsByTagName("script")[0];i.parentNode.insertBefore(o, i);<br /> }();</script>';<br />} By following these steps, the tracking code should work for the Spanish version of your site as well. If this solution doesn't look relevant to your issue, please feel free to open a new support ticket with us: Contact WPML Support |
|
2 | 6 | 1 year, 6 months ago |