Learn how to track custom events in Google Analytics 4 on your Jimdo website, including user interactions, form submissions, and e-commerce events.
Prerequisites
Before implementing event tracking:
- GA4 installed on your Jimdo site (Installation Guide)
- Basic understanding of JavaScript
- Access to Jimdo Head code section
- GTM installed (recommended for easier management)
Tracking Methods
Method 1: Direct gtag.js Events
Add event tracking code directly to your Jimdo site.
Method 2: Google Tag Manager (Recommended)
Use GTM for more flexible event management without code changes.
Common Event Tracking Use Cases
1. Button Click Tracking
Track when visitors click important buttons on your Jimdo site.
Using Direct GA4 Code
Add to your Jimdo Head section (after GA4 initialization):
<script>
document.addEventListener('DOMContentLoaded', function() {
// Track all button clicks with class "cta-button"
const buttons = document.querySelectorAll('.cta-button');
buttons.forEach(function(button) {
button.addEventListener('click', function() {
gtag('event', 'button_click', {
'button_text': this.textContent,
'button_location': window.location.pathname
});
});
});
});
</script>
Using GTM (Recommended)
Step 1: Create Click Trigger
- GTM → Triggers → New
- Trigger Type: Click - All Elements
- Enable Some Clicks
- Condition: Click Classes contains
cta-button - Name:
Click - CTA Button - Save
Step 2: Create GA4 Event Tag
- GTM → Tags → New
- Tag Type: Google Analytics: GA4 Event
- Configuration Tag: Select your GA4 Configuration tag
- Event Name:
button_click - Event Parameters:
button_text:\{\{Click Text\}\}button_url:\{\{Click URL\}\}
- Triggering: Select
Click - CTA Button - Save and Publish
2. Form Submission Tracking
Track when visitors submit forms on your Jimdo site.
Using Direct GA4 Code
<script>
document.addEventListener('DOMContentLoaded', function() {
// Track contact form submissions
const contactForm = document.querySelector('#contact-form');
if (contactForm) {
contactForm.addEventListener('submit', function() {
gtag('event', 'form_submission', {
'form_name': 'contact_form',
'form_location': window.location.pathname
});
});
}
});
</script>
Note: Replace #contact-form with your actual form selector.
Using GTM (Recommended)
Step 1: Enable Form Variables
- GTM → Variables → Configure
- Enable: Form Element, Form Classes, Form ID
Step 2: Create Form Trigger
- GTM → Triggers → New
- Trigger Type: Form Submission
- Enable All Forms or specific form conditions
- Name:
Form - Contact Submission - Save
Step 3: Create GA4 Event Tag
- GTM → Tags → New
- Tag Type: Google Analytics: GA4 Event
- Event Name:
form_submission - Event Parameters:
form_id:\{\{Form ID\}\}form_destination:\{\{Page Path\}\}
- Triggering: Select
Form - Contact Submission - Save and Publish
3. Outbound Link Tracking
Track when visitors click links to external websites.
Using Direct GA4 Code
<script>
document.addEventListener('DOMContentLoaded', function() {
// Track all external links
const links = document.querySelectorAll('a[href^="http"]');
links.forEach(function(link) {
// Check if link is external
if (link.hostname !== window.location.hostname) {
link.addEventListener('click', function(e) {
gtag('event', 'click', {
'event_category': 'outbound',
'event_label': this.href,
'transport_type': 'beacon'
});
});
}
});
});
</script>
Using GTM (Recommended)
Outbound clicks are tracked automatically if Enhanced Measurement is enabled in GA4.
To track via GTM:
Step 1: Create Click Trigger
- GTM → Triggers → New
- Trigger Type: Click - All Elements
- Enable Some Clicks
- Condition: Click URL does not contain
yourdomain.com - Name:
Click - Outbound Link - Save
Step 2: Create GA4 Event Tag
- GTM → Tags → New
- Tag Type: Google Analytics: GA4 Event
- Event Name:
outbound_click - Event Parameters:
link_url:\{\{Click URL\}\}link_text:\{\{Click Text\}\}
- Triggering: Select
Click - Outbound Link - Save and Publish
4. Scroll Depth Tracking
Track how far visitors scroll down your pages.
Using GTM (Recommended)
Step 1: Enable Scroll Variables
- GTM → Variables → Configure
- Enable: Scroll Depth Threshold, Scroll Depth Units
Step 2: Create Scroll Trigger
- GTM → Triggers → New
- Trigger Type: Scroll Depth
- Vertical Scroll Depths: Percentages -
25,50,75,90 - Name:
Scroll - Depth Tracking - Save
Step 3: Create GA4 Event Tag
- GTM → Tags → New
- Tag Type: Google Analytics: GA4 Event
- Event Name:
scroll - Event Parameters:
scroll_depth:\{\{Scroll Depth Threshold\}\}
- Triggering: Select
Scroll - Depth Tracking - Save and Publish
Note: GA4 automatically tracks 90% scroll if Enhanced Measurement is enabled.
5. Video Engagement Tracking
Track video plays on your Jimdo site.
For YouTube Videos (Using GTM)
Step 1: Enable YouTube Video Trigger
- GTM → Triggers → New
- Trigger Type: YouTube Video
- Capture: Start, Progress (25%, 50%, 75%), Complete
- Name:
Video - YouTube Engagement - Save
Step 2: Create GA4 Event Tag
- GTM → Tags → New
- Tag Type: Google Analytics: GA4 Event
- Event Name:
video_{{Video Status}} - Event Parameters:
video_title:\{\{Video Title\}\}video_url:\{\{Video URL\}\}video_percent:\{\{Video Percent\}\}
- Triggering: Select
Video - YouTube Engagement - Save and Publish
E-commerce Tracking
For Jimdo Online Store, implement custom e-commerce tracking.
Product View Event
Track when visitors view product pages:
<script>
// Add to product page Head section (Jimdo Creator only)
document.addEventListener('DOMContentLoaded', function() {
// Get product details from page
const productName = document.querySelector('.product-title')?.textContent;
const productPrice = document.querySelector('.product-price')?.textContent;
const productId = document.querySelector('[data-product-id]')?.dataset.productId;
if (productName && productPrice && productId) {
gtag('event', 'view_item', {
currency: 'USD', // Replace with your currency
value: parseFloat(productPrice.replace(/[^0-9.]/g, '')),
items: [{
item_id: productId,
item_name: productName,
price: parseFloat(productPrice.replace(/[^0-9.]/g, '')),
quantity: 1
}]
});
}
});
</script>
Important: Adjust selectors (.product-title, .product-price) to match your Jimdo theme.
Add to Cart Event
Track when products are added to cart:
<script>
document.addEventListener('DOMContentLoaded', function() {
// Find add to cart button
const addToCartButton = document.querySelector('.add-to-cart-button');
if (addToCartButton) {
addToCartButton.addEventListener('click', function() {
const productName = document.querySelector('.product-title')?.textContent;
const productPrice = document.querySelector('.product-price')?.textContent;
const productId = document.querySelector('[data-product-id]')?.dataset.productId;
gtag('event', 'add_to_cart', {
currency: 'USD',
value: parseFloat(productPrice.replace(/[^0-9.]/g, '')),
items: [{
item_id: productId,
item_name: productName,
price: parseFloat(productPrice.replace(/[^0-9.]/g, '')),
quantity: 1
}]
});
});
}
});
</script>
Purchase Event
Track completed purchases on order confirmation page:
Jimdo Creator: Add to the order confirmation page's Head section:
<script>
// This requires access to order data
// Implementation depends on how Jimdo exposes order information
gtag('event', 'purchase', {
transaction_id: 'ORDER_ID', // Get from order confirmation
value: 99.99, // Total order value
currency: 'USD',
items: [
{
item_id: 'PRODUCT_ID',
item_name: 'Product Name',
price: 99.99,
quantity: 1
}
]
});
</script>
Note: E-commerce tracking on Jimdo requires manual implementation and may be complex. Consider using GTM with custom HTML tags for more flexibility.
Creating a Custom Data Layer
Since Jimdo doesn't provide a native data layer, create your own:
<script>
// Add to Head section (before GTM or GA4)
window.dataLayer = window.dataLayer || [];
// Push custom data
dataLayer.push({
'pageType': 'homepage', // or 'product', 'contact', etc.
'userType': 'guest', // or 'customer' if logged in
'language': 'en'
});
</script>
Use Data Layer with GTM
Create Data Layer Variables in GTM:
- Variable Type: Data Layer Variable
- Data Layer Variable Name:
pageType - Name:
DLV - Page Type
Use in triggers and tags:
- Create trigger conditions based on
pageType - Pass as event parameters
- Create trigger conditions based on
Jimdo-Specific Selectors
Common CSS selectors for Jimdo elements:
Jimdo Creator
.cc-button /* Buttons */
.cc-form /* Forms */
.cc-product /* Product items */
.cc-header /* Header */
.cc-footer /* Footer */
Jimdo Dolphin
.c-button /* Buttons */
.c-form /* Forms */
.c-product /* Products */
Find selectors: Use browser Developer Tools (F12) → Inspector to find exact class names.
Testing & Debugging
1. Use GA4 DebugView
Enable debug mode:
gtag('config', 'G-XXXXXXXXXX', {
'debug_mode': true
});
Then check GA4 → Admin → DebugView to see events in real-time.
2. Use GTM Preview Mode
- GTM → Preview
- Enter your Jimdo site URL
- Click Connect
- Perform actions and verify events fire
3. Browser Console
Check for errors:
// Verify gtag is loaded
console.log(window.gtag);
// Monitor data layer
console.log(window.dataLayer);
4. Event Parameter Validation
Ensure event parameters follow GA4 requirements:
- Parameter names: lowercase with underscores
- Values: strings or numbers (no objects/arrays)
- Currency: ISO 4217 codes (USD, EUR, GBP)
- Value: numeric, no currency symbols
Common Issues
Events Not Firing
Check:
- GA4 base code is installed
- Event code added after GA4 initialization
- No JavaScript errors in console
- Selectors match actual page elements
- GTM container published (if using GTM)
See Events Not Firing for detailed troubleshooting.
Duplicate Events
Cause: Event tracking code added multiple times.
Fix:
- Check for duplicate code in Head section
- Verify GTM tags aren't duplicating direct code
- Use GTM OR direct code, not both
Wrong Event Parameters
Common mistakes:
// Wrong
value: "$99.99" // String with currency symbol
currency: "dollars" // Not ISO code
// Correct
value: 99.99 // Number
currency: "USD" // ISO 4217 code
Best Practices
1. Use Meaningful Event Names
// Good
gtag('event', 'contact_form_submit');
// Avoid
gtag('event', 'click');
2. Add Relevant Parameters
gtag('event', 'button_click', {
'button_text': 'Get Started',
'button_location': 'hero_section',
'page_title': document.title
});
3. Don't Over-Track
Track meaningful interactions only:
- Important button clicks (CTAs, sign-ups)
- Form submissions
- Key page engagement
- E-commerce actions
Avoid tracking every single click.
4. Document Your Events
Keep a spreadsheet of:
- Event names
- When they fire
- What parameters they include
- Where they're implemented
5. Test Before Publishing
Always test in:
- GA4 DebugView
- GTM Preview mode
- Browser console
- Incognito mode (clear cache)
Jimdo Creator vs. Dolphin
Event Tracking Capabilities
| Feature | Creator | Dolphin |
|---|---|---|
| Direct event code | Full access | Limited |
| Page-specific events | Yes | No (global only) |
| GTM integration | Full support | Full support |
| E-commerce tracking | Manual setup | Manual setup |
| Custom selectors | Full control | Limited themes |
Recommendation: Use GTM on both platforms for maximum flexibility.
Next Steps
- Install GTM - For easier event management
- Troubleshoot Events - Debug tracking issues
- GA4 Setup Guide - Initial installation
For general event tracking concepts, see GA4 Event Tracking Guide.
For privacy issues related to tracking, see Privacy Troubleshooting.