hello, can You help me with sdk answer? I have this kind of facebook comment and share, NOT login. https://snag.gy/HXav1b.jpg and I want to use facebook analytics just to see how many users seen my pages. I put this script on every pages from my website. <!————Facebook popup——–><script> window.fbAsyncInit = function() { FB.init({ appId : '215619111894710', xfbml : true, version : 'v3.0' }); FB.AppEvents.logPageView(); }; (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 = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));function logViewedContentEvent(contentType, contentData, contentId, currency, price) { var params = {}; params[FB.AppEvents.ParameterNames.CONTENT_TYPE] = contentType; params[FB.AppEvents.ParameterNames.CONTENT] = contentData; params[FB.AppEvents.ParameterNames.CONTENT_ID] = contentId; params[FB.AppEvents.ParameterNames.CURRENCY] = currency; FB.AppEvents.logEvent(FB.AppEvents.EventNames.VIEWED_CONTENT, price, params);};</script><!————Facebook popup——–> Will this show me data on facebook analitycs about all my visitors? Log in to Reply
2 responses to “Facebook connect SDK using Javascript tutorial for beginners”
hello, can You help me with sdk answer? I have this kind of facebook comment and share, NOT login. https://snag.gy/HXav1b.jpg
and I want to use facebook analytics just to see how many users seen my pages. I put this script on every pages from my website.
<!————Facebook popup——–>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '215619111894710',
xfbml : true,
version : 'v3.0'
});
FB.AppEvents.logPageView();
};
(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 = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
function logViewedContentEvent(contentType, contentData, contentId, currency, price) {
var params = {};
params[FB.AppEvents.ParameterNames.CONTENT_TYPE] = contentType;
params[FB.AppEvents.ParameterNames.CONTENT] = contentData;
params[FB.AppEvents.ParameterNames.CONTENT_ID] = contentId;
params[FB.AppEvents.ParameterNames.CURRENCY] = currency;
FB.AppEvents.logEvent(FB.AppEvents.EventNames.VIEWED_CONTENT, price, params);
};
</script>
<!————Facebook popup——–>
Will this show me data on facebook analitycs about all my visitors?
If you have any question contact me 😉