There are many places you can hook in. If you only have list facets (as 
opposed to numeric range facets, hierarchical facets), then look in

    
http://static.simile.mit.edu/exhibit/api-2.0/scripts/ui/facets/list-facet.js

and find

    Exhibit.ListFacet.prototype._filter = function(value, label, 
selectOnly) {

That's what you want to override.

    <script>
       var oldFilter = Exhibit.ListFacet.prototype._filter;
       Exhibit.ListFacet.prototype._filter = function(value, label, 
selectOnly) {
          // do your logging here

          oldFilter.call(this, value, label, selectOnly);
       };
    </script>

You can also hook into the code that generates the DOM for the facet 
values in

    http://static.simile.mit.edu/exhibit/api-2.0/scripts/util/facets.js

Search for

    Exhibit.FacetUtilities.constructFacetItem
    Exhibit.FacetUtilities.constructFlowingFacetItem

(the first is used for facets that scroll and the second for facets that 
don't scroll). You can see those

    SimileAjax.WindowManager.registerEvent

calls.

Cheers,

David

Kevin Smith wrote:
> Hi,
>
> Does anyone know how to attach on-click events to a facet? My goal is to 
> be able track facet usage using google analytics.
>
> Thank you,
>
> Kevin Smith
> Monterey County Weekly
>
>
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>   

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to