SOLVED: Adding code in header/footer

Hello,

I need to add this code in my website (anywhere will work, head, footer, anything but not in a iframe)

<script type="text/javascript" src="https://weglot.com/api/weglot.js"></script>
<script> 	
Weglot.setup({ 	  
api_key: 'XXXX', 	  
originalLanguage: 'fr', 	
destinationLanguages : 'en,es'
});
</script>

It seems that it’s possible with WIX code to integrate an external such a script but I’m not familiar with the WIX API. Do I have to use a HTML iframe and then use some postMessage function, or is there a way to integrate it directly in “Site code” ?

Thanks a lot

2 Likes

Hi,
You don’t have a direct access to the HTML code of your site. Therefore, you cannot add tags to the header / footer of your site. The only option, as you mentioned, is adding HTML iframe and using postMessage. You can get more information about it here .

Best,
Tal.

Thanks Tal, this seems to be a bit complicated.
Do you know if there is a plan a near future to allow such a snippet in the code ?

Thanks

Hey,
There’s no option to have access to the HTML code and there’s no plan for such a feature.
You can add header tags as explained here or an iFrame as explained above.

Best,
Tal.

Thanks Tal, but the header tags is not for form documentation

I’m afraid that currently it’s impossible to add tags to your header.
Can you please clarify what you would like to achieve? Do you wish to translate your site’s content using this script?

Hi there, I’m also trying to add some code to my site as follows:

I’m aware from reading above that it’s not possible for me to add this between the head tags myself, so can somebody from wix do this for me?

Thanks

Hi,
I’m glad to inform that we’ve released a new track and analyze feature. Click here to learn more about it.
For further questions regarding this feature, please contact Wix support team.

Have a good day,
Tal.

Hi there, thanks for the reply.

Unfortunately, this doesn’t really help with my query. I am trying to add script from Google AdSense to my site. The aim is to automatically optimise the ads it shows on each page. To do this, the script has to be in the header. As I am aware I can’t do this myself, I am requesting assistance from one of your team. My partner and I run several sites through Wix and have done for years. We’d really appreciate the help from you guys. If this isn’t possible, we may have to start looking elsewhere for providers, which we really don’t want to do. We’ve always enjoyed using Wix, but we need to get AdSense up and running in the way we require.

Hi there!

Same issue here, adsense app is a bit outdated by today’s standards, especially for mobile devices. Can’t even show ads in-articles properly as there is no way to use adsense app in the blog editor. Today’s trend is automatic placing a .js srcipt in the . Will have to look somewhere else too if nothing is done on that front.

Hi,
Check out this article, It might suit your needs.
It allows you to embed a custom code to your site.
Good luck!
Roi.

Hi Mate, Thanks for the wonderful tip!! It is not working for me. I am getting " blocked:mixed-content " error while debugging via the browser developer tools. Could it be because its “http” not “https”? Thanks

Super helpful, this let me connect Mailchimp in a custom way.

I’ve read through this old thread, but I’m still not clear on how to add a snippet of code to the footer of a site. It’s for tracking LinkedIn traffic from an ad. LinkedIn requires that it be located in the footer. I’ve placed the code in the “body - end” section. Is that the same as the footer? If not, please advise.

Thanks.

Hey guys, I’m trying to add a custom code through Tracking and Analytics feature in Wix Dashboard and set it to add it to head but it adds it to body no matter what I try. I tried everything without luck. Unfortunately, the custome code works only when it’s in the head. Appreciate any help. Anyway using corvid?

Hello guys I have a the same problem I’m trying to add the custom code using tracking and the analytics features in wix dasboard and set it to head but no avail in my site . Please any clue?

Note that this forum is dedicated to Corvid. For questions regarding Tracking and Analytics, please contact the Wix support team , as they know best.

Feel free to come back and visit if you have questions on coding.

I I guess my question is to check if there’s a way to add it to the head using Corvid since we tried contacting Wix support team and they couldn’t help so as I see it, it is relevant to this forum?

@jp1 No, not really relevant to this forum. Code that goes into the Tracking and Analytics is specialized code. Most of the time you will need to ask the supplier.

Corvid won’t help as it has no access to the header and footer for Tracking and Analytics.