---
title: "Practical Hook Examples"
description: "Production-ready Mumara Campaigns hook examples for common extension use cases, tested against the live codebase."
url: https://campaigns.kb.mumara.com/en/articles/67-practical-hook-examples
collection: "Developer Guides"
updated: 2026-07-24
language: en
---

# Practical Hook Examples

Production-ready Mumara Campaigns hook examples for common extension use cases, tested against the live codebase.

This is a library of production-ready hook recipes you can copy into `/includes/hooks/` and adapt — each one is tested against the actual Mumara Campaigns codebase.

The examples cover the most common extension scenarios:

-   **CRM sync** — push contacts to HubSpot or Salesforce on `AddContact`, `EditContact`, and `DeleteContact`, including access-token caching.
    
-   **Notifications** — Slack alerts on `StartBroadcast`, `CompleteBroadcast`, and `SystemPauseBroadcast`; email alerts on sending-domain verification events.
    
-   **Webhooks** — HMAC-signed webhooks on contact, open (`EmailOpened`), and click (`LinkClicked`) events.
    
-   **Analytics** — send open/click/campaign metrics to a custom endpoint, or inject Google Analytics via the `HeadEnd` and `BodyEnd` output hooks.
    
-   **UI customization** — dashboard widgets (`addPageHtml`), sidebar menu items (`PrimaryMenu`), and alert bars.
    
-   **Validation & compliance** — block disposable email domains, MX checks, GDPR audit logging, and rate limiting.
    
-   **Automation** — auto-tag contacts by engagement and start drip sequences on events.
    

A dedicated section documents extending the **Plan & Usage** page (`/plan`) via the `plan_tabs`, `plan_sections`, and `plan_hide` filter hooks — adding addon tabs and sections, hiding core entries, choosing between the `visible` (hide entirely) and `available` (locked "contact admin" state) closures, and reusing the shared `plan._meter` partial. Every example wraps external calls in try-catch and logs failures, so a broken integration never blocks core operations — follow the same pattern in your own hooks.

📖 [**Read the full guide on docs.mumara.com →**](https://docs.mumara.com/campaigns/hooks/examples)
