Create a Rule
Create an EVENTS, select Key Press for Event Types:
Here you need to do some settings for the event type Key Press, and you need to locate it. Here, use the CSS method to locate it.
Return to the page of the website, move the mouse to the position you want to track, that is, the input box
and then right-click to view Inspect, and the cursor will be positioned at the line of the source code where you are. Then copy it as follows:
Paste into Elements matching the CSS selector:：
Order is set to 30, because some keyboard clicks will cause the page to jump, so the priority needs to be higher.
There are other settings here, such as And having certain property values 、and is changed to the following value…and Advanced options (Bubbling)
and is changed to the following value …: You can set a default value, compare with this, and trigger only when it is consistent.
Advanced options (Bubbling) generally check the first two by default. Copying CSS using the method above is already positioned to the lowest level, so there is no relationship of inclusion.
These settings can be selected by default.
Create the first Action and set event1 to Key Press. The specific settings are as follows:
Create a second Action and set it do not treat is as a page views. The specific settings are as follows:
The final complete Rules setup is:
Publish & Test
Publish a version and test it.
Simulation operation, you can see that the set event1 has been tracked.