IntermediateNovember 18, 20263:46

# Validate events and create custom metrics with the Trackingplan agent

Ask the Trackingplan agent to edit an event spec, create an event, or create, star and delete a custom metric. Nothing is saved until you approve.

Ask the Trackingplan agent to rename a destination, create an event with its spec, make a property required, and create, star or delete a custom metric. Nothing is saved until you approve the card.

In the video, on a demo workspace, the agent creates the `purchase_test` event with four properties (an enum, a required ID, an optional number and a GUID regex), makes `value` required, and creates a custom metric for the orders paid with PayPal.

More in [Threads](/docs/threads) and in the release notes: [edit an event spec from the chat](/changelog/edit-an-event-spec-from-the-chat), [create and delete events from the chat](/changelog/create-and-delete-events-from-the-chat) and [create and delete custom metrics from the chat](/changelog/create-and-delete-custom-metrics-from-the-chat).

Transcript

Validating the spec of every event and creating custom metrics takes a lot of clicks. With the agent, it takes one sentence. I'll show you how to do both using the Trackingplan chat. When you have many destinations, it's hard to tell which one is which. You can give each one an alias in Settings and Members, but you can also do it straight from the chat. To do that, we open a new thread and ask it to rename the GA4 destination with this ID to "GA4 Demo Account". Before making any change, the agent always asks for confirmation. Here, we say yes. Once the change is done, the destination now shows up as GA4 Demo Account, with just one event. We can also create events and edit their specs. For example, let's create a purchase event in this destination with several properties. We ask it to create an event called purchase\_test, with a payment\_method property of type enum (credit card, PayPal), a required transaction\_id, an optional numeric value, and a userID in GUID format. You can also add descriptions and notes to the event. Here, we ask it to add the #ecommerce label. As before, it asks us to confirm the change. We say yes. Once it's done, we can see we now have two events. The second one has its four properties defined: payment\_method is an enum with the values we specified, and userID is a regex that validates the GUID format. We can also edit or delete a property. In this case, we'll edit the value property of the event and make it required instead of optional. We accept the change. And we can see that value is now required for the purchase\_test event. You can also create custom metrics. Just ask for it. Let's create a custom metric that counts the purchase\_test orders paid with PayPal, and mark it as a favorite. It asks us to validate the rules for the custom metric. We say yes. We also want to mark it as a favorite. Here's the result. The metric is starred, and we can see its definition: it takes every purchase\_test event where the payment method is PayPal. You can also ask it to delete specific events or custom metrics. For example, we can ask it to delete "PayPal transactions". It will ask us to confirm. And we can see the metric has been deleted. That's all. I hope this short video helps you get more out of Trackingplan, especially when working with event specs. Bye!

Share Copy link [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fwww.trackingplan.com%2Fvideos%2Fvalidate-events-and-create-custom-metrics-with-the-agent) [X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.trackingplan.com%2Fvideos%2Fvalidate-events-and-create-custom-metrics-with-the-agent&text=Validate%20events%20and%20create%20custom%20metrics%20with%20the%20Trackingplan%20agent)

This video

Playlist

[New at Trackingplan](/playlist/new-at-trackingplan)

Position

01 / 10

Level

Intermediate

Length

3:46

Watch on

[YouTube ↗](https://www.youtube.com/watch?v=5DpqxoZBdtw)

**Stop babysitting tags**

Trackingplan audits your real user data around the clock and flags issues before they cost you.

[Start free trial →](https://app.trackingplan.com/signup)

Next in New at Trackingplan

[Watch it all →](/playlist/new-at-trackingplan)

-   [![](https://i.ytimg.com/vi/UWvebgjaS14/hqdefault.jpg) 3:29Intermediate
    
    ### Trackingplan AI Debugger: An AI Agent for Tracking Warnings
    
    See Trackingplan's AI Debugger in action, the AI agent that finds tracking warnings, explains errors, and improves data quality and tracking accuracy.
    
    ](/videos/trackingplan-ai-debugger-an-ai-agent-for-tracking-warnings)
-   [![](https://i.ytimg.com/vi/IMPnjB6_PC8/hqdefault.jpg) 1:14Intermediate
    
    ### Live Mode: Monitor Your Tracking Data in Real-Time | Instant Hit Validation
    
    Track every hit as it happens. With Live Mode, you can validate, test, and debug analytics events across your website and apps in real time, all in one place.
    
    ](/videos/monitor-tracking-data-in-real-time)
-   [![](https://i.ytimg.com/vi/Oq1G10UF8VI/hqdefault.jpg) 1:05Intermediate
    
    ### Live Debugging: Find Your Own Session
    
    Debug your own session—even on high-traffic sites. Use Trackingplan’s Live Debugging to isolate your hits and verify every event fires as expected.
    
    ](/videos/live-debugging-find-your-own-session)

Trackingplan

## See everything. Miss nothing.

Your implementations audited around the clock with real-time, real-user data. Real-time alerts about errors or changes in your data, campaigns, pixels, privacy and consent. Let AI flag issues before they cost you.

[Start free trial →](https://app.trackingplan.com/signup) [Book a demo](/demo)
