Skip to content

Commit 6d42d38

Browse files
authored
Merge pull request #853 from googleads/recommendation-tags
Add new recommendation devsite tags
2 parents bcee4d0 + e0661f8 commit 6d42d38

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/recommendations/detect_and_apply_recommendations.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ def detect_and_apply_recommendations(client, customer_id):
5353
client: an initialized GoogleAdsClient instance.
5454
customer_id: a client customer ID.
5555
"""
56+
57+
# [START detect_keyword_recommendations]
5658
googleads_service = client.get_service("GoogleAdsService")
5759
query = f"""
5860
SELECT
@@ -83,13 +85,15 @@ def detect_and_apply_recommendations(client, customer_id):
8385
operations.append(
8486
build_recommendation_operation(client, recommendation.resource_name)
8587
)
88+
# [END detect_keyword_recommendations]
8689

8790
# If there are operations present, send a request to apply the
8891
# recommendations.
8992
if operations:
9093
apply_recommendations(client, customer_id, operations)
9194

9295

96+
# [START build_apply_recommendation_operation]
9397
def build_recommendation_operation(client, recommendation):
9498
"""Creates a ApplyRecommendationOperation to apply the given recommendation.
9599
@@ -119,6 +123,7 @@ def build_recommendation_operation(client, recommendation):
119123

120124
operation.resource_name = recommendation
121125
return operation
126+
# [END build_apply_recommendation_operation]
122127

123128

124129
# [START apply_recommendation]

0 commit comments

Comments
 (0)