Hi,

I took a look at the documentation I've linked and it shows a coding snippet 
for setting a rule based audience list for visitors to a website. The example 
is as below:

// Get the user list service.
AdwordsUserListServiceInterface userListService =
    adWordsServices.get(session, AdwordsUserListServiceInterface.class);

// Use built-in parameter to create domain URL rule.
StringKey urlKey = new StringKey("url__");

StringRuleItem urlStringRuleItem = new StringRuleItem();
urlStringRuleItem.setKey(urlKey);
urlStringRuleItem.setOp(StringRuleItemStringOperator.CONTAINS);
urlStringRuleItem.setValue("example.com");

RuleItem urlRuleItem = new RuleItem();
urlRuleItem.setStringRuleItem(urlStringRuleItem);

RuleItemGroup ruleItemGroup = new RuleItemGroup();
ruleItemGroup.setItems(new RuleItem[] {urlRuleItem});

Rule rule = new Rule();
rule.setGroups(new RuleItemGroup[] {ruleItemGroup});

// Create the user list.
ExpressionRuleUserList expressionUserList = new ExpressionRuleUserList();
expressionUserList.setName("All visitors to example.com");
expressionUserList.setDescription("Any visitor to any page of example.com");
expressionUserList.setRule(rule);
expressionUserList.setMembershipLifeSpan(365L);
expressionUserList.setStatus(UserListMembershipStatus.OPEN);

// Optional: To include past users in the user list, set the
// prepopulationStatus to REQUESTED.
expressionUserList.setPrepopulationStatus(
    RuleBasedUserListPrepopulationStatus.REQUESTED);

// Create and submit the operation.
UserListOperation operation = new UserListOperation();
operation.setOperator(Operator.ADD);
operation.setOperand(expressionUserList);

UserListReturnValue result =
    userListService.mutate(new UserListOperation[] {operation});
Long userListId = result.getValue(0).getId();

Is "visiting your website" the event trigger you're mentioning? Or are you 
looking for another event trigger?

Thank you,

Bryan Li
Google Ads API Team
ref:_00D1U1174p._5004Q23tK9U:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/by-Sa000000000000000000000000000000000000000000000QFFAWL00-swqXDvtRZmU2d-t6mgQ_Q%40sfdc.net.

Reply via email to