Tracking links in google map infowindows

I just switched over to Piwik and I am trying to track links in info windows of google maps on my site. The links are generated by js and php/mysql . I tried putting class=“piwik_link” in the urls in my database but that does not work. Any suggestions on how to track those links. Here is one of my pages www.conneroutdoors.com/hunting/alabama.html, thanks in advance for your help, Pete

In http://piwik.org/docs/javascript-tracking/
Check out the section: Force a click on a link to be recorded as an outlink in Piwik

I have tried putting the class=piwik_link" into the urls I want to track, but I can not get them to work. when I check them with firebug there is no call to piwik when I click on these links.

I recommend to use

trackLink( url, linkType, customData )- Manually log a click from your own code. url is the URL clicked. linkType can either be ‘link’ for an outlink or ‘download’ for a download.

Thanks Matthieu,
I can get the trackLink( url, linkType, customData ) to work using a onclick event in the url, onclick=“piwikTracker.trackLink( url, linkType, customData );” but it only groups all the outlinks under URL. is there a way to use the actual url for each one instead. Like the other links get listed. I know I could do it manually for each link, but I have over 2000 links to track.

outlinks are grouped by URL but you can click on the row to see the full list of outlinks for this domain ?

Thanks again, I get nothing like that. I must be doing something wrong. (javascript is not my strong point) All I get under outlinks for the links I use onclick=“piwikTracker.trackLink( ‘url’, ‘link’, ‘customData’ );” on is one listing titled URL and the clicks for each link get counted under unique clicks, there is not a separate list of the actual urls of the links. I will post a screen shot when I can get back into Piwik. Having problems with new upgrade.

Here is a screen shot of what I get .

[attachment=1831:sceenshot_piwik.jpg]

url should be a variable or object property, eg theElementYouClickedOn.href, not the literal string ‘URL’.

customdata is optional; it’s typically a variable.

I understand that if I use a variable like “Outfitter_name” and use a different name for each link it would work. But I have over 1600 links I need to track and the time needed to insert a different name into each is prohibitive. I just don’t know enough javascript to write a code that would take the actual url and insert it as the variable. Thanks for all your help. Pete

Have you tried enableLinkTracking() ?

yes, but it won’t track the links that are in the infowindows, they are from pulled from a database and displayed in the popup infowindows from google maps. other than that it tracks all my other links. you can see what i mean here www.conneroutdoors.com/hunting/alaska.html just click on any marker and you will see the links I am referring to.

Sorry…I had to chase my toddler out of my office.

You may have to defer the call to enableLinkTracking() until after the map loads.

sorry, but I was just able to log back in, I tried to defer the script but it still doesn’t work. and IE did not like that at all, page would not load.

In alaska.js, I see:

    function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent(html);
        infoWindow.open(map, marker);

      });
    }

Why can’t you add a trackLink() call within this click handler?

Like I said earlier I am not that good at javascript, and I am not sure how or where to define that call. is there an example somewhere I could see.

We need YOUR help! We are running a crowd funding campaign to raise funds to implement the detailed Visitors Maps of Countries, Regions and Cities (for all countries)!

These maps will be beautiful, usable, and built using open standards SVG+JS. They will show detailed visitor count, conversion rates, by Country but also (New!) by city and region.

Pledge now at: http://crowdfunding.piwik.org/analytics-maps-world-country-city-region/

Piwik needs you!

We need YOUR help! We are running a crowd funding campaign to raise funds to implement the detailed Visitors Maps of Countries, Regions and Cities (for all countries)!

These maps will be beautiful, usable, and built using open standards SVG+JS. They will show detailed visitor count, conversion rates, by Country but also (New!) by city and region.

Pledge now at: http://crowdfunding.piwik.org/analytics-maps-world-country-city-region/

There will be no more flash in Piwik and we will add amazing new Maps of your visitors.

Piwik needs you!

We need YOUR help! We are running a crowd funding campaign to raise funds to implement the detailed Visitors Maps of Countries, Regions and Cities (for all countries)!

These maps will be beautiful, usable, and built using open standards SVG+JS. They will show detailed visitor count, conversion rates, by Country but also (New!) by city and region.

Pledge now at: http://crowdfunding.piwik.org/analytics-maps-world-country-city-region/

There will be no more flash in Piwik and we will add amazing new Maps of your visitors.

Piwik needs you!