Topic-icon Facebook page follow not working when using facebook code directly

Active Subscriptions:

None
Hello,
I have an issue that confuses me.
I have set up a newsletter subscription form (you can test it here accademiainfinita.it/index.php?option=co...rizione-newsletter-4)

the form is set to display youtube and facebook page follow button after the user subscribes

I tried several solutions but the Facebook page follow button never shows up, only the Youtube button is being displaied

First I grabbed the facebook page follow code from facebook directly

the javascript

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/it_IT/sdk.js#xfbml=1&version=v2.10&appId=468818456633207";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>


and the html

<div class="fb-follow" data-href="www.facebook.com/accademiainfinita" data-layout="standard" data-size="small" data-show-faces="true">


but the button was not showing up,
then I looked at the source page code and noticed this code right after the <body> tag

<script type="text/javascript">

window.fbAsyncInit = function() {
FB.init({version: 'v2.5',appId: '468818456633207', status: false, cookie: true, xfbml: true});
FB.Event.subscribe('comment.create', jfbc.social.facebook.comment.create);
FB.Event.subscribe('comment.remove', jfbc.social.facebook.comment.remove);
FB.Event.subscribe('edge.create', jfbc.social.facebook.like.create);
FB.Event.subscribe('edge.remove', jfbc.social.facebook.like.remove);
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/it_IT/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>


I guess this is being inserted by JFBConnect, maybe it's conflicting with the code I grabbed from facebook directly?
I noticed also that the 2 javascripts are different (the one JFConnect is inserting automatically and the one I grabbed from here developers.facebook.com/docs/plugins/follow-button)

Anyway... I tried to insert the html without the javascript, only

<div class="fb-follow" data-href="www.facebook.com/accademiainfinita" data-layout="standard" data-size="small" data-show-faces="true">


Then I tried to insert the JFBConnect snippet instead
{SCFacebookFollow href=https://www.facebook.com/accademiainfinita layout=standard show_faces=true}
it does not work (I guess because this is not a Joomla article where I am trying to insert the code?)

If you could help me understand what I am doing wrong, that would be appreciated!

Thank you
The topic has been locked.
Support Specialist
Sometimes if you have multiple insertions of the javascript, it can cause conflicts. You should not need to add it to the page, as JFBConnect is already adding it.

Then I tried to insert the JFBConnect snippet instead
{SCFacebookFollow href=https://www.facebook.com/accademiainfinita layout=standard show_faces=true}
it does not work (I guess because this is not a Joomla article where I am trying to insert the code?)


This easy-tag looks correct to me. You should be able to insert it on any page on your site. It does not need to be in a Joomla article to render. So a few questions to narrow down the problem:
* In the JFBConnect backend > Social > Misc tab, do you have anything set for the 'Social Tag Admin Key' setting? If so, this will need to be included on the easy-tag as well like

{SCFacebookFollow href=https://www.facebook.com/accademiainfinita layout=standard show_faces=true key=xyz}
* Does the easy-tag get stripped out or does it still remain on the page when you try to add it?
* Could you add it to the page again and temporarily disable the JFBCSystem plugin to make sure the easy-tag is present on that page? Sometimes it's hard to know which layout file to add it to?
* Are there any errors on the Javascript console?
* Could you try temporarily adding the SCSocialWidget module to the page with provider Facebook and widget Follow button to see if it renders properly or has the same error?

Let me know how these suggestions work for you and we'll go from there.

-Melissa

The topic has been locked.
Active Subscriptions:

None
Hi Melissa,
thank you for your help!

* In the JFBConnect backend > Social > Misc tab, do you have anything set for the 'Social Tag Admin Key' setting?
No, there's nothing there

* Does the easy-tag get stripped out or does it still remain on the page when you try to add it?
It remains on the page, you ca test it here accademiainfinita.it/index.php?option=co...rizione-newsletter-4

* Are there any errors on the Javascript console?
Yes
Uncaught ReferenceError: chronoforms_validation_signs is not defined
at Object.success (index.php?option=com_chronoforms5&chronoform=iscrizione-newsletter-4:381)
at j (jquery.min.js?d11fda0f6295d848286b87c7e0232a9e:2)
at Object.fireWith [as resolveWith] (jquery.min.js?d11fda0f6295d848286b87c7e0232a9e:2)
at x (jquery.min.js?d11fda0f6295d848286b87c7e0232a9e:4)
at XMLHttpRequest.<anonymous> (jquery.min.js?d11fda0f6295d848286b87c7e0232a9e:4)

File Attachment:


* Could you try temporarily adding the SCSocialWidget module to the page with provider Facebook and widget Follow button to see if it renders properly or has the same error?
I did and the module works just fine
The topic has been locked.
Support Specialist
Looking at the page, there are extra spaces in the easytags around the = and : signs, so we're not parsing out the parameters correctly.

Can you edit the article in the backend again and toggle the editor to just see raw HTML? Then remove the spaces, save and refresh on the frontend to see if the problem is resolved.
{SCFacebookFollow href = https: //www.facebook.com/accademiainfinita layout = standard show_faces = true}
should be
{SCFacebookFollow href=https://www.facebook.com/accademiainfinita layout=standard show_faces=true}

-Melissa
The topic has been locked.
Active Subscriptions:

None
mmmh... strange, looks fine to me even looking at the source code
anyway I reinserted the code, this is the html code that get displaied once a user subscribes using that form

<p>Perfetto! Seguici anche sui social per non perderti nulla.</p>
<script src="apis.google.com/js/platform.js">
<p>{SCFacebookFollow href=https://www.facebook.com/accademiainfinita layout=standard show_faces=true}


<div class="g-ytsubscribe" data-channelid="UCFA_MpTAXg1XuNuVXFbeEqQ" data-layout="default" data-count="default">&nbsp;</div>

still not working though,
Thank you
The topic has been locked.
Support Specialist
Could you try adding another easy-tag to the page to see if it gets rendered: {JFBCLogin}?
* If it adds the social login buttons then I think there may still be weird characters in there.
* If not, could you try ordering the JFBCSystem plugin before other system plugins on your site? Sometimes the timing of other plugins may interfere with our parsing.

-Melissa
The topic has been locked.
Active Subscriptions:

None
6 years 6 months ago - 6 years 6 months ago #62932 by fb_1580132693

mel wrote: Could you try adding another easy-tag to the page to see if it gets rendered: {JFBCLogin}?
* If it adds the social login buttons then I think there may still be weird characters in there.
* If not, could you try ordering the JFBCSystem plugin before other system plugins on your site? Sometimes the timing of other plugins may interfere with our parsing.

-Melissa


{JFBCLogin} does not render as well, I also ordered the JFBCSystem plugin as first, but it doesn't solve the issue.
I can provide superadmin access if you want to try to debug yourself.
Thanks
Last edit: 6 years 6 months ago by fb_1580132693.
The topic has been locked.
Support Specialist
Sure, send me a private message with the credentials. To do that, click on the envelope icon under my avatar.

-Melissa
The topic has been locked.
Active Subscriptions:

None
Done,
thanks a lot Melissa.
The topic has been locked.
Active Subscriptions:

None
Hello,
my subscription just expired, is this the reason I am not receiveing any more updates on this issue?

Thank you
The topic has been locked.