Hello,

I want to track what users are sharing with "Share Module" (which allows to send links to nodes by mail, post to Del.icio.us,...

The last field of the settings form says "code to execute on click". Well, I don't know which click it is (the one of displaying the gadget or the one of submitting any of the options) but I trying to find how to use it.

As I did not find aany documentation I am trying to do something really simple, like the code below (it works in any body field with PHP filter:

alert('Hello')

But it did not seem to work at all, the page reload when I push the "Share" icon.

Does anybody has any clue on how to use this filed or on how to track what users are sending away with the "Share module".

Many thanks for any help,

Ramón

Comments

ramonovelar’s picture

The code I inserted in the last message had the script open and closure tags which obviusly have been filtered...

greenSkin’s picture

The 'code to execute on click' is a ShareThis functionality that I have simply allowed access to via the field. I believe the code is meant to execute when the ShareThis link is clicked to open the popup. You should not include the

tags and don't forget to end the statement with a semi-colon.
ramonovelar’s picture

Sorry because I'm maybe doing questions that are quite elementary from the point of view of PHP syntax. Following your instructions I have put in the "code to execute on click" field the following code:
alert('Hello');
And the outcome remains the same: the page reloads (at least, it scrolls back to the top) and the Share menu does not open.

Obviously, in order to achieve what I need (track users choices to share) this is just a preliminary step. I would need, beforehand, to build a new table in the database and later on find the way to make an insert with the user id, node id and service used to share. I'm just trying to check the possibilities for tracking user choices. As you said, the code executes when the icon is clicked, therefore I think I would need to place the orders somewhere else.

Many thanks for your help,