Re: [PHP] LightBox click detection

2013-06-16 Thread Micky Hulse
On Fri, Jun 14, 2013 at 8:52 AM, Tedd Sperling t...@sperling.com wrote:
 Here's the problem --  I need to count the number of times a user activates a 
 LightBox -- how do you do that?

If you're using Google Analytics, you can use click tracking:

https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

I recently setup click tracking on lightbox open, close and various
other modal window bits/pieces for a metered pay wall system.

For example, within the lightbox/modal window open method:

[code]

// Track this lightbox instance:
window._gaq.push([
'_trackEvent',  // Method.
'Paymeter Lightbox',// Group.
'Lightbox OPEN group ' + count_txt, // Append count to action text.
count_txt + ' OPEN event'   // Prepend count to label text.
]);

[/code]

The advantage to using a common tool like analytics is that it's got a
ton of powerful ways to analyze the data.

Not sure the goal of your project, but I thought I would mention.

Cheers,
M

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-15 Thread Tamara Temple
Tedd Sperling t...@sperling.com wrote:
 It's Friday so I am allowed to ask odd questions.

W00T! Friday!

 Here's the problem --  I need to count the number of times a user activates a 
 LightBox -- how do you do that?
 
 Here's a LightBox Example:
 
http://www.webbytedd.com/c2/lightbox/
 
 All the javascript is there (jQuery et al).
 
 Ideally, I would like to have a php/javascript combination that would:
 
 1. Detect when a user clicked the LightBox;
 2. Pass that value to PHP so I can keep count.
 
 Any ideas?

First off, do you have the javascript code available in an unsquished
form? That would mean I could read it.

Not knowing whether your JS code or Lightbox has any hooks that you can
take advantage of, I'd steal the onclick event from those images that
start lightbox, fire off an AJAX request and ignore the return, then
fire the lightbox event handler.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-15 Thread Tamara Temple
Marc Guay marc.g...@gmail.com wrote:
 $('.lightbox-image-class').click(function(){
 $.post('ajax.php', {click: true});
 });

Do javascript DOM events stack? If they do, this is definitely the
simplest way to go. If they don't, you need to capture the previous
click handler and call it.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-15 Thread Julian Wanke

They do, afaik...

Am 15.06.2013, 20:11 Uhr, schrieb Tamara Temple tamouse.li...@gmail.com:


Marc Guay marc.g...@gmail.com wrote:

$('.lightbox-image-class').click(function(){
$.post('ajax.php', {click: true});
});


Do javascript DOM events stack? If they do, this is definitely the
simplest way to go. If they don't, you need to capture the previous
click handler and call it.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] LightBox click detection

2013-06-15 Thread Bastien
Sorry 'bout the top post.

That's how I do it. Capture the click event with jquery and Ajax that back to 
the server

Bastien Koert

On 2013-06-15, at 2:07 PM, Tamara Temple tamouse.li...@gmail.com wrote:

 Tedd Sperling t...@sperling.com wrote:
 It's Friday so I am allowed to ask odd questions.
 
 W00T! Friday!
 
 Here's the problem --  I need to count the number of times a user activates 
 a LightBox -- how do you do that?
 
 Here's a LightBox Example:
 
   http://www.webbytedd.com/c2/lightbox/
 
 All the javascript is there (jQuery et al).
 
 Ideally, I would like to have a php/javascript combination that would:
 
 1. Detect when a user clicked the LightBox;
 2. Pass that value to PHP so I can keep count.
 
 Any ideas?
 
 First off, do you have the javascript code available in an unsquished
 form? That would mean I could read it.
 
 Not knowing whether your JS code or Lightbox has any hooks that you can
 take advantage of, I'd steal the onclick event from those images that
 start lightbox, fire off an AJAX request and ignore the return, then
 fire the lightbox event handler.
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-14 Thread Marc Guay
$('.lightbox-image-class').click(function(){
$.post('ajax.php', {click: true});
});

and do your DB work in ajax.php

http://api.jquery.com/jQuery.post/

On 14 June 2013 09:52, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 It's Friday so I am allowed to ask odd questions.

 Here's the problem --  I need to count the number of times a user activates a 
 LightBox -- how do you do that?

 Here's a LightBox Example:

http://www.webbytedd.com/c2/lightbox/

 All the javascript is there (jQuery et al).

 Ideally, I would like to have a php/javascript combination that would:

 1. Detect when a user clicked the LightBox;
 2. Pass that value to PHP so I can keep count.

 Any ideas?

 Cheers,

 tedd

 _
 t...@sperling.com
 http://sperling.com
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] LightBox click detection

2013-06-14 Thread Marc Guay
Also, the docs and functionality for that particular plugin seem a bit
weak.  Maybe there's another one that has a doneLoadingLightbox
event that you could hook into and call your ajax script inside of...


On 14 June 2013 10:02, Marc Guay marc.g...@gmail.com wrote:
 $('.lightbox-image-class').click(function(){
 $.post('ajax.php', {click: true});
 });

 and do your DB work in ajax.php

 http://api.jquery.com/jQuery.post/

 On 14 June 2013 09:52, Tedd Sperling t...@sperling.com wrote:
 Hi gang:

 It's Friday so I am allowed to ask odd questions.

 Here's the problem --  I need to count the number of times a user activates 
 a LightBox -- how do you do that?

 Here's a LightBox Example:

http://www.webbytedd.com/c2/lightbox/

 All the javascript is there (jQuery et al).

 Ideally, I would like to have a php/javascript combination that would:

 1. Detect when a user clicked the LightBox;
 2. Pass that value to PHP so I can keep count.

 Any ideas?

 Cheers,

 tedd

 _
 t...@sperling.com
 http://sperling.com
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php