The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Tracking Expands with Google Analytics Event Tracking (3 posts)

  1. sackerman
    Posted 4 years ago #

    Hi everybody, I'm wondering if its possible (and if so, how to) to track expands with the "Event Tracking" feature built into Google Analytics.

    Any insights?



  2. WStringer2
    Posted 4 years ago #

    Hi sackerman...funny you should ask, this is something I just got working this morning.

    There may be a better way, but here's how I did it:

    • Add an ID to the "Read More" image:
      [expand title="<img id='readMoreImg' src='imgs/read-more.jpg' />" trigclass="noarrow" tag="div"]
    • Add some jQuery (after the [/expand] tag) that will add an "onClick" event to the image.
    • Set up the onClick event to call the GA event tracking, then return true (so Collapse-O-Matic will keep working after the event is called)
    • So my jQuery looks something like this:

      <script type="text/javascript">
      	jQuery("#readMoreImg").attr("onClick", "_gaq.push(['_trackEvent', 'ReadMore', 'Clicked', 'Event Title Goes Here']);return true");

      Hope this helps!

  3. sackerman
    Posted 4 years ago #

    Looks like it may do the trick!
    Thanks a ton WStringer2, i'll post back with my findings!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Collapse-O-Matic
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic