Topic-icon Google Analytics Events Integration?

9 years 3 months ago #50382 by yorron
hi there,

i'm using a lot of GA Events on my site, to measure every click possible.

but - i'm not measuring the different clicks on JFBConnect, which are some of the most important clicks on the site.... Likes, Shares, Logins, Comments, etc...

is there anyway i can put the GA Events code in the JFBC plugins code? or configure it in any other way?
what i need most is Events on the social Likes plugins / modules inside articles, and the social logins buttons on their different locations.

i would be happy to know if this is any way possible, and if not, maybe it's a planned feature for the component.

edit: i also noticed in the component backend - "social -> notifications/analytics" - that there is an option called "Add Google Analytics Tracking for New Likes". it is market as "yes". i have GA configured on the site - should i see this likes information anywhere in GA?

thanks a lot,
yorai ronen
The topic has been locked.
Support Specialist
9 years 3 months ago #50386 by alzander
Yorai,
The setting you mention calls the following Javascript from our jfbconnect.js file whenever a Facebook Like button is clicked or Facebook comment is left:
FB.Event.subscribe('edge.create', function (targetUrl)
                        {
                            _gaq.push(['_trackSocial', 'facebook', 'like',
                                targetUrl, opt_pageUrl]);
                        });
                        FB.Event.subscribe('edge.remove', function (targetUrl)
                        {
                            _gaq.push(['_trackSocial', 'facebook', 'unlike',
                                targetUrl, opt_pageUrl]);
                        });
                        FB.Event.subscribe('message.send', function (targetUrl)
                        {
                            _gaq.push(['_trackSocial', 'facebook', 'send',
                                targetUrl, opt_pageUrl]);
                        });
                        FB.Event.subscribe('comment.create', function (targetUrl)
                        {
                            _gaq.push(['_trackSocial', 'facebook', 'comment',
                                targetUrl, opt_pageUrl]);
                        });
                        FB.Event.subscribe('comment.remove', function (targetUrl)
                        {
                            _gaq.push(['_trackSocial', 'facebook', 'uncomment',
                                targetUrl, opt_pageUrl]);
                        });
                    }
Basically, we use the _gaq.push method to push different activitys to Google Analytics. There are different ways to push events, and what we do may not be compatible with your Google Analytics tags. Hopefully the above gives you some insight into what we're doing and where to look in your analytics, but if not, let us know.

We don't support analytics tracking for the other social buttons because many of them don't have Javascript callbacks we can use like Facebook does.

Thanks,
Alex
The topic has been locked.
9 years 3 months ago #50395 by yorron
hi Alex,

thanks for the quick reply.

now i see the tracking in GA - thanks for the explanation.

your mehtod for calling events is the same 1 i use, so it's great.

you mentioned the tracking only support FB, but on GA i also see likes from google+ - see screen shot:
File Attachment:

i also see it on another site i use JFBC.

if i override the code you quated from jfbconnect.js and replace it with GA events, will it caus any issues besided in the "social -> notifications/analytics" feature?

thanks for the info
yorai
The topic has been locked.
Support Specialist
9 years 3 months ago #50403 by alzander
Google automatically tracks the +1 button when you use Google Analytics. You can read more about that on this page:
developers.google.com/analytics/devguide...ajs/gaTrackingSocial
See the Introduction which explains that.

As for the overriding of our code, it should work, but of course you could break things depending on what you do. From the picture, it looks like Facebook is working.. so not sure what you want to do, but feel free to edit away and let us know what you come up with.

Thanks,
Alex
The topic has been locked.
9 years 3 months ago #50435 by yorron
hi Alex,
thanks for explaining.

the change from social to events might be necesery in some uses of GA, depending on what your measuring and how.

anyway don't think i'll change anything for now.

thanks again
yorai
The topic has been locked.
Support Specialist
9 years 3 months ago #50439 by alzander
Yorai,
No problem for the help. If you do run into issues with the above, let us know. We'll help however we can.

Thanks,
Alex
The topic has been locked.