Hello, I have installed the module and configured:
1. Set permissions for users.
2. Configured Home » Administration » Configuration » Web services » External Link Popularity
3. Create a node with a Link type using the Link module.
4. Using Framework theme I have updated node.tpl.php with:
<div id="node-<?php print $node->nid; ?>" class="node"> at top, closing with
at bottom. This adds <div id="node-2" class="node"> as example in my HTML page.
5. Confirmed that the .js is loading with the page.
Tried to record link clicks, but the database is still empty. Checked pop_links_stats and has zero rows.
I have switched to Garland theme, and still not luck.
Any ideas?
Thanks,
Tim
Comments
Comment #1
hejeva commentedDid you make sure permissions are set so anoymous and/or authenticated can "Record external clicks"?
Comment #2
nkschaefer commentedSorry it took me so long to respond. I'll look into this to see if there's anything strange going on, but I think there's probably a simple solution: the module (like the Drupal 6 version of it) is set not to track user with ID 1 (the admin/webmaster), regardless of roles and permissions. I ran into this and was confused by it too when I first started working on porting the Drupal 6 version to Drupal 7, and I can try to come up with a way to make it clearer that user 1 won't be tracked, or add a checkbox to the settings form to allow user 1 to be tracked.
As for the markup you need to track a node, you have the right thing. I've made the Drupal 7 version more flexible (it now uses Javascript settings), so I might introduce a hook sometime soon where custom modules can specify what classes/IDs should look like when tracking clicks in a node body.
Please let me know if you're still encountering problems.
Comment #3
Tim Jones Toronto commentedHi, I did check permissions and wanted to confirm that i was doing things correctly.
I will re-test it again from scratch and report back any problems :)
Thanks for your update!
Tim
Comment #5
scuba_flyever fixed this? I'm having an similar problem.
Comment #6
therobyouknow commentedI have an interim solution that seems to work ( after using it, admin/reports/pop_links shows the links )
this solution is theme dependent on bootstrap as it uses the .btn-success class. Ultimately we want to move to a theme independent solution and one which uses Drupal.behaviours rather than jquery directly. Then I will submit a patch for this module.
( Credit and thanks to Clive for providing a robust way to access the Drupal node id for a page here: http://drupal.stackexchange.com/a/78667/1082 )
// at line 72: in pop_links.module of pop_links module folder (additional args and some code tacked onto end)
in pop_links.js (much commented out -the root cause seems to be that the original jquery/javascript code wasn't firing)
Credit to colleague Andy for some lightening fast Jquery coding:
Comment #7
therobyouknow commentedWee correction on comment number 6:
I think the
is extraneous in the above js. Being present it causes the link to not open - you stay on the same page.
I'll confirm tomorrow. Try removing it yourself if you saw the problem yourself.
Comment #8
therobyouknow commentedAs promised, this is the corrected pop_links.js code (from above in comment 6 and discussed in comment 7) to use with the php code alterations for pop_links.module as described in comment 6. Enjoy and feedback.