Site logo

Archived topic

Add Viglink to Site

3 replies · Started by Ana on January 6, 2021

Viewing posts 1–4 of 4

Hello, How can I add the Viglink script to my site? I've been using the Hook in Elements wp_header, wp_footer, Entire Site and it does not work. Here is the script as well as the instructions. When the script is inserted it cannot be found by Viglink. There are already other hooks inserted and are working properly. GP Premium 1.12.3

Please advise.
Thanks.
Ana

Paste the //Commerce Code on your pages
This code should be inserted at the very end of your pages, just before the </body> tag.

The code needs to be present on every page where you'd like //Commerce to work. The best way to install this code everywhere is to add it to your site's template.

<script type="text/javascript">
var vglnk = {key: 'e621c055220ba5b1ab6fde3a36677e4d'};
(function(d, t) {
var s = d.createElement(t);
s.type = 'text/javascript';
s.async = true;
s.src = '//cdn.viglink.com/api/vglnk.js';
var r = d.getElementsByTagName(t)[0];
r.parentNode.insertBefore(s, r);
}(document, 'script'));
</script>

Hi there,

The instruction says:

This code should be inserted at the very end of your pages, just before the </body> tag.

That means it should be in the wp_footer hook:
https://docs.generatepress.com/article/wp_footer/

If you've tried that and it's not working then you will need to check with Viglin's support team.

Ok Thank you!

No problem :)

This archived topic is closed to new replies.