1

I'm trying to build a dashboard based on data from recaptcha enterprise. I only got the score metrics data, but not the actions data.

Is it possible to get the actions that can be found on recaptcha dashboard on GCP?

enter image description here

By using this code, I can get the score metrics. I also notice that it includes challenge metrics, but it's weird there is no data at all included in it. I wonder if the challenge and score metrics is the same?

from google.cloud import recaptchaenterprise_v1

def sample_get_metrics():
    # Create a client
    client = recaptchaenterprise_v1.RecaptchaEnterpriseServiceClient()

    # Initialize request argument(s)
    request = recaptchaenterprise_v1.GetMetricsRequest(
           name="name_value",
    )

    # Make the request
    response = client.get_metrics(request=request)

    # Handle the response
    print(response)
start_time {
  seconds: 1649055600
}
score_metrics {
  overall_metrics {
    score_buckets {
      key: 0
      value: 0
    }
  }
}
challenge_metrics {
}
Tenserflu
  • 520
  • 5
  • 20

1 Answers1

0

The ScoreMetrics returned from GetMetrics may have both overall_metrics as well as action_metrics, where you would be interested in the latter.

action_metrics | map<string, ScoreDistribution>
Action-based metrics. The map key is the action name which specified by the site owners at time of the "execute" client-side call. Populated only for SCORE keys.

Note that these are only available for SCORE keys, as opposed to CHECKBOX keys. https://cloud.google.com/recaptcha-enterprise/docs/keys

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218