Цей плагін не перевірявся з останніми 3-ма основними випусками WordPress. Можливо, він більше не може розроблятися або підтримуватися, і він може мати проблеми сумісності при використанні з більш новими версіями WordPress.

Track a click on Google Analytics

Опис

Are you using UTM Source to track link clicks within your website?

That’s a really bad idea! Not only will it create a new session with the links utm_source and inflate your visitor stats, it will also increase the bounce rate on the page you’re tracking.

So what’s the solution?

Use [event tracking] (https://developers.google.com/analytics/devguides/collection/analyticsjs/events) on Google Analytics which capture events like a link click into your Google Analytics Dashboard.

For e.g.
Download Free Ebook

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:
* You use Google Tag Manager to insert Google Analytics
* You use Monster Insights Plugin (Formerly Yoast’s Google Analytics Plugin) to install Google Analytics

Відгуки

Прочитати всі 1 відгук

Учасники та розробники

“Track a click on Google Analytics” — проект з відкритим вихідним кодом. В розвиток плагіну внесли свій вклад наступні учасники:

Учасники

Перекладіть “Track a click on Google Analytics” на вашу мову.

Цікавитесь розробкою?

Перегляньте код, перегляньте сховище SVN або підпишіться на журнал розробки за допомогою RSS.