For security reasons the build-in editor doesn't allow the onclick
HTML attribute. So you want to use the Google Analytics Event Tracking service, this plugin helps to you.
- Google Analytics: Event Tracking
- Add new events on the Back-end > Settings > Tracking Visitors page.
- Insert the Google Analytics code to the head of website.
- Insert the jQuery JavaScript library to the website.
- Add the Google event code component to the current layout or page.
- Extend the links or buttons with the special attributes.
Name | Description |
---|---|
data-google-event-name | the name of event. It is required attribute. |
data-google-event-action | the name of action. Default: the value of Action field in the current event. |
Event name: interest-contact
HTML code: <a href="{{ 'contact'|page }}" data-google-event-name="interest-contact">Contact</a>
- en - English
- hu - Magyar
- sl - Slovenščina
- Go to the Settings > Updates & Plugins page in the Backend.
- Click on the Install plugins button.
- Type the Tracking Visitors text in the search field.