Record button press


(stahbud) #1

I have a page that prints a coupon when this button is pressed.

onclick="javascript:PrintIframe();

How would I measure this in Piwik?

I have multiplr pages useing the same script to print a different coupon for each page.

Thanks…


(Matthieu Aubry) #2

Try something like:


(stahbud) #3

Rocketed right over my head…


(Matthieu Aubry) #4

sorry my answer was wrong, misunderstood :wink:


// Change this
onclick="javascript:test()"

// for this
onclick="javascript:test() && piwikTracker.trackPageView('Click banner 1')"

making sure the piwik code is above this line. It should work and count as a page view the click ?


(stahbud) #5

onclick="javascript printIframe();
This is the click I want to record.

onclick=“javascript printIframe(); && piwikTracker.trackPageView(‘Click banner 1’)”

is this the code I should put after

onclick=“javascript printIframe(); && piwikTracker.trackPageView(‘Click banner 1’)”