A custom event tag allows you to track events like button clicks, newsletter subscriptions and other custom events on your site. Each custom event is labeled with an event category and action. It may also contain the name and value of the event.
To create and set up the custom event tag, follow these steps:
- Go to Menu > Tag Manager.
- Navigate to Tags.
- Click Add a tag.
- Name your tag and select the following type: Custom event.
- Click Next.
- Add the following elements:
- Category (string, required): The category of the event you’re tracking. The category organizes events into groups. Example:
Buttons
. - Action (string, required): The action of the event you’re tracking. The action tells you what a visitor did. Example:
Click
. - Name (string, optional): The name of the event you’re tracking. The name gives you more information about the event. Example:
Sign up
(a CTA on your button). - Value (float, optional): The value you want to assign to the event you’re tracking. Example:
5
. If an action is worth some money for your business, like a signup button click is worth 5 USD, you can assign a value for it. Every time an event happens, Piwik PRO will count the value and show the total value in an event report.
Note: You can track a previously created custom dimension along with the event by picking the index number of the dimension and providing its value. For more, read this article.
- Category (string, required): The category of the event you’re tracking. The category organizes events into groups. Example:
- In Advanced tag settings, choose Consent type. Set it up if you use a consent form on your site. This tag will only fire for visitors who accept the selected consent type.
- Respect opt-out and DNT is turned on by default. Leave it as is if you want to respect visitors who’ve turned on the Do-Not-Track feature in their browsers or who’ve opted out of tracking using our opt-out form.
- In Flight dates, set the date and time when the tag will fire.
- In Tag triggers, click Add a trigger or Choose existing trigger to set up a trigger for your tag.
- Click Save.
- Test your tag in debug mode.
- When you’re happy with how the tag works, click Publish.
- All set! After a while, data will be collected and you’ll see it in Menu > Analytics > Reports > Custom events.
Tip: See some examples of using custom events: