Google Analytics Event Tracking on Worpdress

我的未来我决定 提交于 2019-12-02 09:06:29

You are initializing GA using the gtag() method so you should be using the gtag() function call for sending events:

gtag('event', 'click', { 'event_category': 'Outbound Link','event_label': 'Book Now'
 });

1) Check if call works on its own, without a click event. You can test the script by copy/pasting the gtag call into the console and see if it makes the connection or if it gives an error. If the connection works you will see a request in the "network" tab of the browsers devtools when manually calling the function.

2) Verify your browser can connect to GA. You can check the "network" tab in devtools to see if all the calls to analytics are being made or if they are blocked. If your running an ad-blocker or running the browser in a privacy/content blocking mode these tracker requests could be getting stopped. Depending on the browser you are using GA may already be blocked by default.

3) Verify analytics can see your requests. Check if analytics is seeing your actions in Realtime tracking. Look for the initial pageview first, if that isn't working make sure your testing with an unfiltered view.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!