开发者 |
gounder
sidmetal98 inkmyweb |
---|---|
更新时间 | 2016年9月1日 11:00 |
捐献地址: | 去捐款 |
PHP版本: | 2.5.0 及以上 |
WordPress版本: | 4.6 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
<a onClick="ga('send', 'event', 'Downloads', 'Click', 'Ebook downloaded', '0');" href="http://example.com/wp-content/uploads/2015/06/free-ebook.pdf">Download Free Ebook</a>
But then the WordPress Visual Editor will keep cleaning out the onClick part, so we made a quick shortcode that would save you from the trouble of redoing the onClick part everytime it got cleaned out.
How does it work?
In place of an A href tag like <a onClick="ga('send', 'event', 'Downloads', 'Click', 'Ebook downloaded', '0');" href="http://example.com/wp-content/uploads/2015/06/free-ebook.pdf">Download Free Ebook</a>
use our shortcode [tac_ga url="http://example.com/wp-content/uploads/2015/06/free-ebook.pdf" category="Downloads" action="Click" label="Ebook Downloaded"]Download Free Ebook[/tac_ga]
By default this shortcode uses the following information:
Category: link
Action: click
Label: The URL Entered
How do I check if this works
Google Analytics' Real time tab will show you that these tags would or not.
Some cases in which this shortcode won't work: