googleads / google-ads-php

Google Ads API Client Library for PHP
https://developers.google.com/google-ads/api/docs/client-libs/php
Apache License 2.0
295 stars 262 forks source link

membership_life_span cannot be set for FlexibleRuleUserList #980

Closed laurachevalier4 closed 8 months ago

laurachevalier4 commented 9 months ago

membership_life_span cannot be set for FlexibleRuleUserList. We should update the add_flexible_rule_user_list example to remove the line that sets this to 365, as this value is ignored for this type of user list. This value is set to a default value of 540 for FlexibleRuleUserList regardless of user-provided value. This is a special case that doesn't apply to other list types, so no need to update other examples.

ephbaum commented 9 months ago

I don't think this right. It seems that the API should allow this update according to documentation. I believe this is actually a bug in the API that needs to be addressed upstream.

laurachevalier4 commented 9 months ago

Hey @ephbaum! Unfortunately the documentation needs to be updated as well – I've been in talks with the team to make that happen, after confirming that this behavior is intended. The docs should state that membership_life_span will be ignored for logical_user_lists and rule_based_user_lists, and automatically set to the maximum membership duration (540 days). Any exclusion logic is handled by the rules themselves.

In the UI for rule-based user lists, what you see is values set through inclusion and exclusion rules. For example, in the screenshot shared in issue #969, the way you would set the value seen under the "Exclude..." header is to set lookback_window_days on the exclusive operands. In the code example, that would mean updating this line similar to how it's done for the inclusive operands. I achieve the following image by updating the exclusive operand code to:

'exclusive_operands' => [
                new FlexibleRuleOperandInfo(['rule' => $userVisitedSite3RuleInfo]),
                'lookback_window_days' => 365
            ]

Does that resolve the issue?

fiboknacky commented 8 months ago

Closing as the solution was provided.