Any guideline for self-coded action?

bzphua
bzphua
Offline
0
Hi, I've purchased Content Statistic recently and needed some custom action to be tracked. My desired action include:
1) Outbound link tracking (use AJAX call to action before out-bounding)
2) DOM tracking - click & scroll ( jQuery + AJAX should do the trick)
3) Individual's user visit duration tracking / time spent on page ( not sure how to do it yet )

I've some knowledge in AJAX and MySQL just that I'm hope to get some guideline on modify the source code with minimal impact on original function, e.g. which file I should edit/add to include more custom Action, which file is the 'Controller' where I could post AJAX call, any modification on database needed, etc. Or better yet, if you could provide a guideline to develop those in a form of plugin I would be grateful.
Thank you.
Responses (7)
  • Accepted Answer

    Friday, July 19 2013, 10:24 AM - #Permalink
    0
    hello,

    1 & 2) the thing about tracking is that our plugin tracks actions in "components". this means that probably the best way to track these custom things would be to add "fake" actions to track (like... index.php?option=com_content&task=fake_action) and then you add this action to track into the plugin. with AJAX, you would be in charge to "call" this URL so the system tracks it.

    but... this is complicated. you really must know what you're doing to track this...

    about number 3) that's something else, you would need to modify the core plugin and somehow start tracking visit duration (also with some kind of ajax tracking...)

    what you describe is technically a bit complicated. we can do these kind of things in our Custom Coding Service.
    The reply is currently minimized Show
  • Accepted Answer

    bzphua
    bzphua
    Offline
    Saturday, July 20 2013, 05:06 PM - #Permalink
    0
    Thank you for the reply, do you have the documentation to define my own action? For example, I would like to track more action in Jomsocial like "Group Video View" and "Group Discussion create".
    The reply is currently minimized Show
  • Accepted Answer

    Monday, July 22 2013, 02:58 PM - #Permalink
    0
    basically you need to take a look at the jomsocial plugin /plugins/contentstats/com_community/com_community.php

    at the beginnig, the function registerStatistic() is the one that tracks data. you can define your own actions there based on the $view or $task variables..
    The reply is currently minimized Show
  • Accepted Answer

    bzphua
    bzphua
    Offline
    Monday, July 22 2013, 03:50 PM - #Permalink
    0
    Thank you for the reply, will take a look later. By the way which place should I place my code to call my 'fake action', it should be place as one of the task in com_content right? For example, when user click on a certain link with class name "record_this", I will post some value like 'component', 'type', 'reference_id' to the task n within the task there will be code to insert them into database.
    The reply is currently minimized Show
  • Accepted Answer

    Monday, July 22 2013, 08:39 PM - #Permalink
    0
    not really, no need to put anything inside the task because you will capture the URL with the plugin itself.
    The reply is currently minimized Show
  • Accepted Answer

    bzphua
    bzphua
    Offline
    Tuesday, July 23 2013, 01:26 AM - #Permalink
    0
    Which plugin will capture the action? I would still need the plugin to identify the post of the 'fake action' , that's mean I still need to edit the code. May I know which part of the code I should edit/add?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, July 23 2013, 12:01 PM - #Permalink
    0
    ok I can see you may be a bit lost.. the plugin will be anyone, the one you decide to create the "fake action" for... but in your case, since you seem to have to modify the com_community plugin, that would be the one...

    just.. at this point... I have to suggest to "don't do anything you don't know"! :)
    The reply is currently minimized Show
Your Reply