I am trying to use the Remarketing feature for the first time. I have got the Remarketing code from Adwords and placed it on the website.

Looking through the examples; i have garnered the below flow.

With #2 i can associate one of my Userlist with a predefined Adgroup to be shown during Remarketing. My question is how do i link the tracker ID that i have received (looks like var google\_conversion\_id = 9925XXXXX) with the code below? where is this linking done? UserListConversionTypes and BasicUserList both have ID's; am i supposed to set any of those or this is done automatically?

Any pointers/help will be appreciated.

Please also let me know if you fine any issue with the code below.

set up remarketing using the AdWords API in two steps:

Create a remarketing list.
 Create a CriterionUserList to tie your list to an AdGroup.

1.Create a remarketing list

Creating a remarketing list involves the creation of two separate entities: the RemarketingList itself and its associated UserListConversionTypes also known as remarketing tags.

The following code shows how to create a remarketing list.

```
    AdWordsServices adWordsServices, AdWordsSession session) throws Exception {
    // Get the UserListService.
    AdwordsUserListServiceInterface userListService =
        adWordsServices.get(session, AdwordsUserListServiceInterface.class);

    // Get the ConversionTrackerService.
    ConversionTrackerServiceInterface conversionTrackerService =
        adWordsServices.get(session, ConversionTrackerServiceInterface.class);

    UserListConversionType conversionType = new UserListConversionType();
    conversionType.setName("Mars cruise customers #" + System.currentTimeMillis());

    // Create remarketing user list.
    RemarketingUserList userList = new RemarketingUserList();
    userList.setName("Mars cruise customers #" + System.currentTimeMillis());
    userList.setDescription("A list of mars cruise customers in the last year");
    userList.setMembershipLifeSpan(365L);
    userList.setConversionTypes(new UserListConversionType[] {conversionType});

    // Create operations.
    UserListOperation operation = new UserListOperation();
    operation.setOperand(userList);
    operation.setOperator(Operator.ADD);

    UserListOperation[] operations = new UserListOperation[] {operation};

    // Add user list.
    userList = userListService.mutate(operations).getValue()[0];

```

2.Tie a remarketing list to an AdGroup

A new type of criteria object called CriterionUserList is now part of v201008. Through this type of criteria you are able to tie a UserList to an AdGroup. As with other types of

criteria, this type is also managed through the AdGroupCriterionService. The following code shows you how to create a CriterionUserList and tie it to an existing AdGroup.

```
    // Create user list criterion.
    CriterionUserList userListCriterion = new CriterionUserList();
    userListCriterion.setUserListId(userListId);

    // Create biddable ad group criterion.
    BiddableAdGroupCriterion biddableCriterion = new BiddableAdGroupCriterion();
    biddableCriterion.setAdGroupId(adGroupId);
    biddableCriterion.setCriterion(userListCriterion);

    // Create operation.
    AdGroupCriterionOperation operation = new AdGroupCriterionOperation();
    operation.setOperand(biddableCriterion);
    operation.setOperator(Operator.ADD);

    AdGroupCriterionOperation[] operations = new AdGroupCriterionOperation[] {operation};

    // Add keywords.
    AdGroupCriterionReturnValue result = adGroupCriterionService.mutate(operations);

```

Thanks,
-Devraj