Maybe this can help someone, I found how to do it.
I have asked many questions but no one commented or did anything, that's not a problem. Working hard can solve many problems.
So my use case iscustom module to create a form and I want to make "timespent" work and track user time spend on this: page.
- I have a custom module to create a form and I want to make "timespent" work and track user time spend on this page.
I use URL to get it work.
$nodetypes = variable_get('time_spent_node_types', 'all');
if ($node = menu_get_object()) {
if (($nodetypes == 'all' || $nodetypes[$node->type] === $node->type )) {
$mynide = $node->nid;
}
}
This code searches the id of the node, for my purposes I replace this like that
if (arg(0) == 'module' && arg(1) == 'form') {
$mynide = arg(3); // for me arg(3) is the nid i want to track
}