Re: [PHP] LightBox click detection

[email protected] (Micky Hulse)
Newsgroups php.general
Message-ID <CALri7MkABLPNnwrmxRQrzkzMOjt+=9WRB_wGy1GmEY+90k4hug@mail.gmail.com>
On Fri, Jun 14, 2013 at 8:52 AM, Tedd Sperling <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.