Custom Events Can Break Custom Metrics

I love to use custom events, but this issue stumped me forever…

I’ll add a custom event to a custom metric formula, and it’ll use a weird string of characters instead.

Custom Event Custom Metric

It’s not just a display issue since the metric won’t calculate results.

Custom Event Custom Metric

Other times the metric just loads and loads and never displays. If I go back to the formula, it breaks the custom event name into separate metrics by space.

This is because the custom metric formula doesn’t like spaces in custom events. If I use a custom event that doesn’t have spaces, it doesn’t transform it into different characters.

Custom Event Custom Metric

It also calculates fine.

Custom Event Custom Metric

It’s an issue that’s unique to custom events, which makes me think it’s an oversight in the development of custom metric formulas. It works fine if your formula uses other metrics that include spaces.

Custom Event Custom Metric

While one option is to change your custom event to eliminate spaces, that may not be ideal since the edit will produce a new event from that point forward. While you should consider removing spaces on any new custom events going forward, it may not be the best solution for existing custom events.

Another option is to create a custom conversion mapped to that event. I use a rule that includes a forward slash in the URL, which should catch all fires. Keep in mind that this will start calculating going forward.

custom conversion

Then use the custom conversion in the custom metric formula (even if the name of the custom conversion has a space in it), and it should work fine.

Custom Metrics

This is one of those problems that may make sense to programmers, but it won’t occur to the rest of us. But there are pretty easy workarounds.