Fix trackMetric to use query strings