Tagged: x
-
AuthorPosts
-
October 5, 2016 at 10:17 am #1203538
SimonParticipantHi team,
I can’t add this javascript code on cutom / eddit global javascript.
If i add this code i can’t save.<script type="text/javascript"> window.sendinblue=window.sendinblue||[];window.sendinblue.methods=["identify","init","group","track","page","trackLink"];window.sendinblue.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);window.sendinblue.push(t);return window.sendinblue}};for(var i=0;i<window.sendinblue.methods.length;i++){var key=window.sendinblue.methods[i];window.sendinblue[key]=window.sendinblue.factory(key)}window.sendinblue.load=function(){if(document.getElementById("sendinblue-js"))return;var e=document.createElement("script");e.type="text/javascript";e.id="sendinblue-js";e.async=true;e.src=("https:"===document.location.protocol?"https://":"http://")+"s.sib.im/automation.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};window.sendinblue.SNIPPET_VERSION="1.0";window.sendinblue.load();window.sendinblue.client_key="uax6d1uu3wj6qfubdzckb";window.sendinblue.page(); </script>Someone have an idea ?
SimonOctober 5, 2016 at 10:32 am #1203563
ThaiModeratorHi Simon,
Please add the following code under functions.php file locates in your child theme:
add_action( 'wp_head', 'add_custom_script' ); function add_custom_script(){ ?> <script type="text/javascript"> window.sendinblue=window.sendinblue||[];window.sendinblue.methods=["identify","init","group","track","page","trackLink"];window.sendinblue.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);window.sendinblue.push(t);return window.sendinblue}};for(var i=0;i<window.sendinblue.methods.length;i++){var key=window.sendinblue.methods[i];window.sendinblue[key]=window.sendinblue.factory(key)}window.sendinblue.load=function(){if(document.getElementById("sendinblue-js"))return;var e=document.createElement("script");e.type="text/javascript";e.id="sendinblue-js";e.async=true;e.src=("https:"===document.location.protocol?"https://":"http://")+"s.sib.im/automation.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};window.sendinblue.SNIPPET_VERSION="1.0";window.sendinblue.load();window.sendinblue.client_key="uax6d1uu3wj6qfubdzckb";window.sendinblue.page(); </script> <?php }Hope it helps 🙂
October 6, 2016 at 2:53 am #1204753
SimonParticipantThanks Thai !
Have a good day !October 6, 2016 at 3:16 am #1204765
Rue NelModeratorYou’re welcome!
Thanks for letting us know that it has worked for you.January 29, 2017 at 7:56 am #1349536
SimonParticipantHi team !
add_action( 'wp_head', 'add_custom_script' ); function add_custom_script(){ ?> <script type="text/javascript"> window.sendinblue=window.sendinblue||[];window.sendinblue.methods=["identify","init","group","track","page","trackLink"];window.sendinblue.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);window.sendinblue.push(t);return window.sendinblue}};for(var i=0;i<window.sendinblue.methods.length;i++){var key=window.sendinblue.methods[i];window.sendinblue[key]=window.sendinblue.factory(key)}window.sendinblue.load=function(){if(document.getElementById("sendinblue-js"))return;var e=document.createElement("script");e.type="text/javascript";e.id="sendinblue-js";e.async=true;e.src=("https:"===document.location.protocol?"https://":"http://")+"s.sib.im/automation.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};window.sendinblue.SNIPPET_VERSION="1.0";window.sendinblue.load();window.sendinblue.client_key="uax6d1uu3wj6qfubdzckb";window.sendinblue.page(); </script> <?php }Is there a way to place this code just before the close tag /head ?
Thanks for help.January 29, 2017 at 8:31 am #1349563
ThaiModeratorHi There,
The code is currently before the close </head> tag.
Did you mean the close </body> tag?
Thanks.
January 29, 2017 at 9:16 am #1349596
SimonParticipantThank you for your response Thai.
As you can see on the capture there are some elements between this script and the closing tag /head
Outside one of these script prevents the automation of Sendinblue. That’s why I would like to see him in last position.
Thank you in advance !
January 29, 2017 at 9:51 am #1349625
ThaiModeratorSo please try updating the code to this:
add_action( 'wp_head', 'add_custom_script', 999 ); function add_custom_script(){ ?> <script type="text/javascript"> window.sendinblue=window.sendinblue||[];window.sendinblue.methods=["identify","init","group","track","page","trackLink"];window.sendinblue.factory=function(e){return function(){var t=Array.prototype.slice.call(arguments);t.unshift(e);window.sendinblue.push(t);return window.sendinblue}};for(var i=0;i<window.sendinblue.methods.length;i++){var key=window.sendinblue.methods[i];window.sendinblue[key]=window.sendinblue.factory(key)}window.sendinblue.load=function(){if(document.getElementById("sendinblue-js"))return;var e=document.createElement("script");e.type="text/javascript";e.id="sendinblue-js";e.async=true;e.src=("https:"===document.location.protocol?"https://":"http://")+"s.sib.im/automation.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)};window.sendinblue.SNIPPET_VERSION="1.0";window.sendinblue.load();window.sendinblue.client_key="uax6d1uu3wj6qfubdzckb";window.sendinblue.page(); </script> <?php }Let us know how it goes!
January 29, 2017 at 10:54 am #1349687
SimonParticipantI will test this and make you a return as soon as possible.
thank you Thai.
January 29, 2017 at 11:03 am #1349695
ThaiModeratorLet us know how it goes!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1203538 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
