Question
Is it possible to get specific usage data on macros, triggers, and automations?
Answer
Although it is not possible to pull this kind of usage data for a specific date, you can obtain usage data for macros, triggers and automations based on the last hour, 24 hours, 7 days or 30 days through the API. There two different types of API calls you can make to obtain this usage data.
Option 1: Filtered API Request
The first type would be to make a filtered request for each. The following parameters are supported when filtering this information via the API:
- usage_1h
- usage_24h
- usage_7d
Example:
https://yoursubdomain.zendesk.com/api/v2/macros.json?sort_by=usage_1h,usage_24h,usage_7d
Try it out! Make sure you're logged in, then select your subdomain from the dropdown below to be redirected directly to this API call in your account.

Option 2: Sideload API Request
The second option would be to make a sideload request, to obtain the usage data for each. Side loading gives you a option for tracking usage over a larger amount of time by allowing you to add the parameter of 30 days to the request. The following sideloading parameters are currently supported:
- usage_1h
- usage_24h
- usage_7d
- usage_30d
Example:
https://yoursubdomain.zendesk.com/api/v2/macros.json?include=usage_1h,usage_24h,usage_7d
22 Comments
Is it possible to get macro usage extending beyond the 30 day limit?
Hi Felicia,
The best way to do this would be to have a unique tag added by the macro, and then you can pull reports on that tag.
More on that can be found in this article:
Insights tag reporting: Reporting on tickets with one or more tags (Professional and Enterprise)
Hello, when I pull data for the last 30d using following the URL above, I only get max 100 results for both macros and triggers.
I wonder if this is a limit, or just a coincidence? If the former, is there a workaround to obtain usage for the entirety of the business rules?
Hi Pedro,
That behavior is expected! Our API pagination only returns 100 results per page for most endpoints.
When the response exceeds the per-page maximum, you can paginate through the records by incrementing the
page
parameter. Example:page=3
. List results includenext_page
andprevious_page
URLs in the response body for easier navigation.Thank you for reaching out!
Perfect! Thanks a lot, Tiann.
This would be a great thing to have - even at the Insight level. For example I am attempting to calculate ticket abandonment rate per year and there is no way I can remotely begin. I have an automation that closes tickets after 10 days of no client response. I wanted to count how many times that fired off per calendar year. Can't do it with Zendesk, it seems.
Michael
As part of the automation’s action, add a unique tag to the ticket such as no_repsonse. You can then search for tickets in Support with that tag or create an Insights report.
Back to Nicole/Pedro's comments, how do I incorporate multiple pages exactly in the URL? I have https://subdomain.zendesk.com/api/v2/macros.json?page=5include=usage_1h,usage_24h,usage_7d
I just don't know where to put the page part. Thank you!
Hey Alexander,
What are you using to pull this data? I ended up using python and can share some code if you'd like about pagination. If you do go the python route I strongly suggest Zenpy (http://docs.facetoe.com.au/)
I can't believe that Zendeks stock answer to this sort of question is always "add a tag". It's such a poor level of customer support. Why not just allow us to access all our data through the API? We're paying you for it!
Hey Russel,
I can promise you that this is not a stock answer and currently using tags is the best way to capture macro usage at this time. I'll be sure to pass your feedback to the appropriate team and greatly appreciate you taking the time to share this with us.
If you do experience any issues tracking macro usage with the method mentioned above please let us know and we'll do whatever we can to help on our end.
Thanks!
Hi there,
I want to pull many reports based on different macros. Some tags are same, some are different between these macros.
Pulling data based on tags is difficult to understand the flow, it will not give a clear picture. Putting new tags is not possible at the moment.
Thanks
Jitendra
Hi Jitendra,
Would the reports from the APIs listed above work for your purposes?
Zendesk, I can't believe there isn't a standard report that can be used to monitor macro use? Is this something that you are working on?
Hi Joan -
Most customers use the tag reporting or API. One user has filed a feature request around macro usage reporting, but it didn't gain much traction as no one else indicated it was something they needed. I encourage you to up-vote her request and add details about your use-case in the comments:
Macro Usage Reporting Capabilities
Hi! This might be a dumb question, but what does "position" indicate exactly? The macro documentation isn't really helpful since it defines "position" as "position", haha.
Thanks!
position is the order zendesk reads the triggers/automations.
Top down. So a trigger/automation can be true (and run on the ticket), then it may get affected by another trigger or automation further down the list.
Hey all,
FYI With our Pythia app we provide Macros Usage stats beyond 30 days period. https://www.zendesk.com/apps/support/pythia-for-support
Thanks for sharing Andrei!
Hi all,
There is a great solution – Advanced Macros Usage Reporting for Zendesk. It is a part of the Advanced Macros by Pythia app https://www.zendesk.com/apps/support/advanced-macros-by-pythia
Alexander, I figured this one out!
https://subdomain.zendesk.com/api/v2/macros.json?per_page=99&page=1&include=usage_30d
This is what I used to retrieve the 1st page of 30 day usage. I had 4, so I had to run it 4 times, but it got me what I needed.
Thanks for sharing your solution, Claire!
Also, I see that this is your first post - welcome to the Zendesk Community!
Please sign in to leave a comment.