Add VigLink Code [Deleted]

There's no reported issues thus far, and there wasn't enough to have changed in XF 1.5 to expect that it would stop working. If you have any problems, let me know, and I'll sort it.
 
Hey @Chris D
I have "Registered Users" selected but do not want it to show for my "Premium Members", but because Premium members are also in the Registered Users group they are seeing the links. How do I configure it so my Premium group does not get the links?
 
You can't exclude your premium usergroup with this addon since you've got everyone's primary as Registered (which is the recommended 'XF way' of permission stacking)

We used template edits in ad_below_bottom_breadcrumb to achieve showing to guests and registered (but not upgraded) usergroups:
Code:
<!-- viglink -->
<xen:if is="!{xen:helper ismemberof, $visitor, 2, 3, 4, 12, 25, 27, 29, 30, 31, 34}">
<script type="text/javascript">
  var vglnk = { key: 'YOUR VIGLINK KEY' };

  (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>
</xen:if>
<!-- End viglink Code -->
 
I tried this plugin on a secure forum with HTTPS enabled but it's giving a warning in Google Chrome "This page is trying to load scripts from unauthenticated sources". Just thought you might want to know.
 
Wouldn't that be more an issue with the script than XF, though? That is something that your VigLink account manager could probably help you with, if that is the case.

I insert my code in my various forums through a template edit, so I don't use the add-on. If you could edit the add-on, what I would try is to replace this line:

Code:
    s.src = '//cdn.viglink.com/api/vglnk.js';

with this:

Code:
    s.src = 'https://cdn.viglink.com/api/vglnk.js';

I may be wrong, but the browser may be balking on the viglink.com script not being loaded via https, where your forum is being loaded via https. Again, they may know at VigLink what is happening.

I have not yet started moving sites to https, but am going to try a few lesser sites and forums using Lets Encrypt. I'm just waiting for the rest of the bugs to be worked out.
 
Ok so this is the default VigLinkCode template:

Code:
<xen:if is="{xen:helper ismemberof, $visitor, $xenOptions.vigLinkGroupSelector} && {$xenOptions.vigLinkID}">
    <script type="text/javascript">
        var vglnk = { api_url: '//api.viglink.com/api',
            key: '{xen:jsescape $xenOptions.vigLinkID}' };

        (function(d, t) {
            var s = d.createElement(t); s.type = 'text/javascript'; s.async = true;
            s.src = ('https:' == document.location.protocol ? vglnk.api_url :
                '//cdn.viglink.com/api') + '/vglnk.js';
            var r = d.getElementsByTagName(t)[0]; r.parentNode.insertBefore(s, r);
            }(document, 'script'));
    </script>
</xen:if>

It looks like this should load the secure version of the script, however it doesn't.
 
Ok so this is the default VigLinkCode template:

...

It looks like this should load the secure version of the script, however it doesn't.

Agreed.

I started replying about the code you pasted in, but for VigLink, that is an outdated script. Do you use the most recent version of Chris's add-on?

If you go to your VigLink "Install" page, generate new code for your site and see how it compares. It shouldn't affect things (they always try to make modifications so your monetization doesn't "break"), but in this case it just might be that the revised code is more friendly to https vs. http requests.

Save some trouble. Uninstall the add-on. Go into your template editor for your Default theme. Open PAGE_CONTAINER. Before the closing <HEAD> tag, paste in your VigLink code you just generated above. See if that changes anything. With https encryption being enabled on more sites now, they may have simplified the code.

This will work until @Chris D could update the add-on to the revised code in the latest version. This is the code I generated today:

HTML:
<script type="text/javascript">
  var vglnk = { key: 'xxxxxxxxxxxxxxxxx' };

  (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>

Hope this helps.
 
The plugin is up to date yes.

If I add the code directly like you suggested it's working ok over https. Thanks.

By the way Viglink recommends adding their code just before the </BODY> tag which is also located in PAGE_CONTAINER.
 
I added the code and have received Zero revenue since I moved over to Xenforo. I had Viglink tech support check and they are stating that they can see the code on the pages and functionally it's working but they agreed it's odd that I went from several hundred a month to zero since I made the move.. thoughts?
 
I had no issues. But as I mentioned, I pasted the code directly into the PAGE_CONTAINER template, rather than use an add-on. (And like @flash84 says, it goes before the closing </body> tag...I mistakenly said elsewhere.)

If you 1) generate code from your Viglink dashboard and 2) do a view source on your forum and find the inserted code, are they exactly the same? I switched sites between platforms myself and never saw a change in revenue either way (beyond the usual day-to-day variations).
 
I would have thought they would be better placed to answer that question.

Yep me too! I'm digoing for options at this point, they gave examples from threads that were working... Is there any kind of tweaking with links that I need to do?
 
I honestly have no idea. The add on just adds their code to pages. I don't actually use it myself. I would actually argue the add on isn't really necessary anymore; it used to be more useful years ago when modifying templates wasn't ideal.
 
Yep me too! I'm digoing for options at this point, they gave examples from threads that were working... Is there any kind of tweaking with links that I need to do?

I honestly have no idea. The add on just adds their code to pages. I don't actually use it myself. I would actually argue the add on isn't really necessary anymore; it used to be more useful years ago when modifying templates wasn't ideal.

Seriously, as I mentioned, just get the proper code from the dashboard, paste it in PAGE_CONTAINER right before </body>, disable Chris's plugin temporarily, and then try it.

If you've done that, you have a "clean" installation, ensuring that even your code is correct. Once you've done that, get back with your account rep and escalate the issue to the technical department if it is still not working. There is no reason it should just suddenly stop working on its own.

Don't go by their "testing" link either. I've tried that for a few years and most of the time, it does not work at all for a couple of my sites, yet they are generating revenue properly.

Let us know what you find!
 
Rudy the test came back negative on first try but I could see Viglink and Google loading in the status bar. I used Ghostery and confirmed that Viglink was indeed loading and that is what queued me to contact Viglink support. Tech support gave me a couple of example links from the forum that they said were working when they tested so it's just odd. I am curious if there is just something to the rewrite issue I had, nothing direct but indirectly affecting traffic.. I will move the code and see what happens.. You guys are smokin awesome...
 
It is hard to help remotely, as you well know. ;)

If there is anything you might feel is interfering (such as a redirect, or other site scripting, any caching, etc.), by all means temporarily disable them and see what happens. If you can pinpoint which day it stopped working, it might help you remember if you changed a configuration on the server, upgraded anything in the OS or Apache/nginx or whatever you're using, etc. The VigLink folks are helpful--you might just have to get the right person to help you realize what is not triggering. With revenues at stake, I always try to resolve any Viglink issues as soon as I can.

Sort of unrelated--I had ElasticSearch failing on me every 36 hours or so. It ran fine previously. I did a routine upgrade of Ubuntu (apt-get upgrade) and Java updated itself. I then noticed a few days later that Elasticsearch hadn't crashed in days. It then occurred to me that a few weeks prior, I had noticed Java upgraded back then. So, that's what was causing ES to fail after all...not anything I had changed myself!
 
Yeah Rudy, the deal is that is all stopped when I moved to Xenforo.. >>>>>> BIG DISCLAIMER HERE <<<<<< I have had nothing but huge praises from my members on the move away from Vbulletin to XENFORO and make no mistake about it, the community here has been extremely supportive to me in this move. So know that when I say it all stopped when I moved forums it's not saying in anyway that the Xenforo software is at fault, its just a fact... I'm sure if you spoke to my wife she would tell you that I messed it up somehow and as usual it will probably be something really ignorant that I did in the wee hours of the morning thinking it was good... As long as I know the big stuff is covered I can dig into the weeds and find the causal factors.. My gut is telling me there is something in a script or filter on the Viglink side that has detected a massive change... Time might just be the answer, I will keep you informed too. I moved the code over to the Page Container file so let's see what happens now... Again, thank you all!
 
Well it looks like I am moving off of Viglink.... I have had a ticket open with them on Jan 31st and we have had numerous emails back and forth. They state that tech support as well as developers have looked at the site and everything is reporting with them correctly. It's amazing how I have been producing revenue since Jan of 2011 and now not a penny.. I give up!

"We've reviewed your account/campaign extensively -- both on the support and engineering side -- and can't see any issues with your installation"
 
Top Bottom