Add/echo div with Analytics-Code to function in functions.php

echo ('<div onClick="ga('send', 'event', 'will-ich-haben', 'klick', 'test-klick');">');

I haven’t looked any further but as a first step, this string isn’t concatenated correctly.

echo "<div onClick='ga('send', 'event', 'will-ich-haben', 'klick', 'test-klick')'></div>";

Leave a Comment