Add experiments examples#887
Conversation
| * the treatment arm automatically generates a draft campaign), modify the system-generated draft | ||
| * campaign, and schedule the experiment. | ||
| * | ||
| * <p>Note: This standard draft-based workflow does not apply to all experiment types (e.g., |
There was a problem hiding this comment.
nit: avoid e.g., per https://developers.google.com/style/word-list#eg
There was a problem hiding this comment.
I can fix this in the golden.
| GoogleAdsServiceClient.SearchPagedResponse response = googleAdsServiceClient.search(request); | ||
|
|
||
| boolean experimentFound = false; | ||
| for (GoogleAdsRow row : response.iterateAll()) { |
There was a problem hiding this comment.
Can you get multiple rows back, given you're filtering by experiment_id? If not, it's a little confusing to have a for loop here. You could use something like https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/collect/Iterables.html#getOnlyElement(java.lang.Iterable) instead.
| } | ||
|
|
||
| // [START get_experiment_performance_1] | ||
| private void evaluateExperiment(GoogleAdsClient googleAdsClient, long customerId, GoogleAdsRow row) { |
There was a problem hiding this comment.
Please add javadocs for each method
| * This example illustrates how to retrieve performance metrics for an experiment. | ||
| * | ||
| * <p>It shows how to query statistical significance metrics for the experiment, | ||
| * and how to execute actions such as promoting, ending, or graduating an experiment. |
There was a problem hiding this comment.
The name and description of this example don't make it obvious that running this will potentially modify the state of the experiment.
There was a problem hiding this comment.
That's a good point. What about something like EvaluateAndUpdateExperiment or something like that?
For the description, do you mean that the first sentence should better capture what the example does, or you think the whole description is incomplete?
There was a problem hiding this comment.
That's a good point. What about something like EvaluateAndUpdateExperiment or something like that?
EvaluateAndUpdateExperiment SGTM. I just want it to be obvious to a user that running this is going to mutate things in their account.
For the description, do you mean that the first sentence should better capture what the example does
Exactly. It should mention the mutate piece. Javadoc uses the first sentence of the description in method summaries and IDEs use those summaries in tooltips, so it's important that the first sentence mentions the sample will modify entities.
| } | ||
|
|
||
| private void graduateExperiment(GoogleAdsClient googleAdsClient, long customerId, String experimentResourceName) { | ||
| String budgetResourceName; |
There was a problem hiding this comment.
Some line-level comments would be helpful since this method performs multiple steps
There was a problem hiding this comment.
I can fix this in the golden. @sarahcaseybot I'll follow up with you on that.
No description provided.