I have successfully got scripts working to retrieve totals of contacts matching various criteria. These criteria include filtering by list, automations stage and tag.
However, when I try using segmentid I am unable to get the correct results. Debugging shows a null response for the id and using different ids always yields the total contacts in the database.
What am I missing?