Google analytics? is a great tool for tracking data. It has an important function of “event tracking.” Event tracking allows us to record user actions, such as clicking on the register member button, video playback, or scrolling screens, etc. As long as the action can be judged, even the mouse movement can be traced.

google analytics

Usually a website must have a required KPI, such as the number of registered members, the number of orders, the number of forms, etc. If no conversion target is established at this time, can the traffic be justified? The next advertisement can only be blindly hit. G.

At this time, you can use the methods ga(‘send’, ‘event’, xx, xx, xx) provided by google analytics to generate events for these actions. After the event is successfully generated, you can set this event as the conversion target again. Can do the tracking of registered members, fill in forms, etc.

However, in fact most of the responsibilities are marketing, technicians may not know how to set up an affair, or they may not have technical staff. This must be done by themselves. In fact, the basic event tracking is not difficult, later to teach you how to write tracking events.

Google analytics Settings Event

First to teach you to set the ga event, below the official file, it is clear how the ga event works, when ga (send, {hitType: ‘event’, xxx }) execution, with hitType event, plus The necessary parameters, event categories, and event actions allow google analytics to receive data. The following program is a simple method of event execution.



A brief introduction about writing

1
2
3
4
5
6
7
8
9
10
//When the user triggers it will be sent Category: Guide List, Action: Click, Tag: Registered Member, Value: 200
ga('send', {
hitType: 'event',
eventCategory: 'nav list', // category (must)
eventAction: 'click', //action (must)
eventLabel: 'register member' //label (option)
eventValue: '200' //value (option)
});
// ==> 下方為簡化
ga('send', 'event', 'nav list', 'click', 'register member', 200);


After writing the parameters of the event, how to trigger it again, we expect the user to click the register and login member button to execute the event record of ga.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Login register button

// 1.html onclick setting
...
<button onclick="ga('send', 'event', 'nav list', 'click', 'login');" id="loginMember" class="btn btn-primary">Login</button>
<button onclick="ga('send', 'event', 'nav list', 'click', 'register', 200);" id="registerMember" class="btn btn-warning">Register</button>
...

// 2.if you can not modify html
// javascript track click
...
<button id="loginMember" class="btn btn-primary">login</button>
<button id="registerMember" class="btn btn-warning">register</button>

<script>
window.addEventListener("DOMContentLoaded", function() {
document.querySelector('#loginMember').addEventListener('click',function(e){
ga('send', 'event', 'nav list', 'click', 'login');
});

document.querySelector('#register').addEventListener('click',function(e){
ga('send', 'event', 'nav list', 'click', 'register', 200);
});
}, false);

</script>

...

sample demo

Simply make two buttons, click on the button below will be issued ga event method, you can let us see the data on the ga, click on the immediate => event to check for success, behavior => event you need Only a few hours of data will appear.


demo:

Check if there is any data in ga and find that the number is successful, and you’re done!
ga instant event


Finally, I wrote the google event generator by the way. If you don’t change the parameters, just copy and paste it. I just didn’t add the parameters to cancel the interaction, and the form didn’t have a special design.

Google analytics Event Set Goal Conversion

The official document has different settings for teaching conversions. We use the events we just created to set the conversions. Then we only need to set the target conversion. Click the administrator in the lower left corner => click target => add target => Custom.

ga conversion target setting1

Select the event and enter the event name
ga conversion target setting2

Test events to see if there is a digit in an instant conversion
ga conversion target setting3

After finishing the event and converting settings

After completing the conversion setup, we can determine which advertising is performing better or which page users are converting based on the conversion figures.

If you are familiar with javascript, you can also write some dynamic judgments. For example, if you track the link of a block and then dynamically bring in the linked tag name or page, you can summarize which link users in this block are most frequently clicked. , which are the most infrequent clicks, etc.

In the case of advertising, I think that the website is setting up ga events. After the conversion, gtm is combined, which is very helpful for judging the effectiveness. If you operate the advertisement but it will not work, then it is recommended that you try to look at the settings. Events and conversions are very useful tools for marketing, giving you more weapons to play on the battlefield.