Custom Events
Create custom events to track specific interactions
What Are Custom Events?
While standard events track the buying journey (view, cart, purchase), custom events let you track other important interactions:
- Newsletter signup button clicks
- Video plays
- Download button clicks
- Social media link clicks
- Banner or promotion clicks
- FAQ accordion opens
- Size guide views
These events appear in GA4 alongside your standard ecommerce events.
Creating a Custom Event
- Open the Pasilobus Google Analytics app
- Scroll to the Custom Events section
- Click Add Custom Event
- Configure your event (see options below)
- Click Save
Event Configuration Options
Event Name
The name that appears in GA4 (e.g., newsletter_signup). Use lowercase with underscores.
Event Type
Choose when the event should fire:
| Type | Use Case |
|---|---|
| Page Visit | Track when customers visit specific pages |
| Click | Track button or link clicks |
| Form Submission | Track form completions |
Page Path (Optional)
Limit the event to specific pages. Leave blank to track on all pages.
Wildcard support: Use * to match any characters in the URL path.
| Pattern | Matches |
|---|---|
/collections/* |
Any collection page |
/products/* |
Any product page |
/pages/faq |
Only the FAQ page |
/blogs/*/tagged/* |
Blog posts with specific tags |
Element Selector (for Click and Form events)
Tell the app which element to track using CSS selectors:
| Selector Type | Example | Tracks |
|---|---|---|
| ID | #newsletter-form |
Element with id="newsletter-form" |
| Class | .signup-button |
Elements with class="signup-button" |
| Data attribute | [data-action="subscribe"] |
Elements with that data attribute |
| Tag + class | button.add-to-wishlist |
Button elements with that class |
Tip: Right-click an element in your browser, select "Inspect", and look for unique IDs or classes.
Example: Track Newsletter Signups
- Event Name:
newsletter_signup - Event Type: Click
- Page Path: Leave blank (track on all pages)
- Element Selector:
.newsletter-submit-button
Example: Track Size Guide Views
- Event Name:
size_guide_view - Event Type: Click
- Page Path:
/products/*(only on product pages) - Element Selector:
[data-action="size-guide"]
Testing Custom Events
After creating a custom event:
- Open your store in a new tab
- Navigate to a page where the event should fire
- Perform the action (click the button, visit the page, etc.)
- Check GA4's DebugView (Admin > DebugView) to see the event in real-time
If the event doesn't fire, double-check your element selector and page path match the actual page.
Event Naming Best Practices
- Use lowercase with underscores:
newsletter_signupnotNewsletterSignup - Be descriptive:
video_playis better thanclick1 - Be consistent: Use the same naming pattern across all custom events
- Avoid spaces and special characters
Managing Custom Events
From the Custom Events section, you can:
- Edit: Update the configuration
- Delete: Remove events you no longer need
- Disable: Temporarily stop tracking without deleting
There's no limit to the number of custom events you can create.