Package com.google.api.ads.adwords.axis.v201402.cm

Examples of com.google.api.ads.adwords.axis.v201402.cm.ConversionTrackerServiceInterface


  public static void runExample(AdWordsServices adWordsServices, AdWordsSession session,
      String conversionName, String gClid, String conversionTime,
      double conversionValue) throws Exception {

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

    // Get the OfflineConversionFeedService.
    OfflineConversionFeedServiceInterface offlineConversionFeedService =
        adWordsServices.get(session, OfflineConversionFeedServiceInterface.class);

    // Create an upload conversion. Once created, this entry will be visible
    // under Tools and Analysis->Conversion and will have "Source = Import".
    UploadConversion uploadConversion = new UploadConversion();
    uploadConversion.setCategory(ConversionTrackerCategory.PAGE_VIEW);
    uploadConversion.setName(conversionName);
    uploadConversion.setViewthroughLookbackWindow(30);
    uploadConversion.setCtcLookbackWindow(90);

    ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation();
    uploadConversionOperation.setOperator(Operator.ADD);
    uploadConversionOperation.setOperand(uploadConversion);

    ConversionTrackerReturnValue conversionTrackerReturnValue = conversionTrackerService.mutate(
        new ConversionTrackerOperation[] {uploadConversionOperation});

    UploadConversion newUploadConversion =
        (UploadConversion) conversionTrackerReturnValue.getValue(0);
View Full Code Here


      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201306.CONVERSION_TRACKER_SERVICE);

      // Replace with a valid value from your account.
      long conversionId = Long.parseLong("INSERT_CONVERSION_ID_HERE");

      // Create conversion with updated status and name.
      AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker();
      adWordsConversionTracker.setId(conversionId);
      adWordsConversionTracker.setStatus(ConversionTrackerStatus.DISABLED);

      // Create operations.
      ConversionTrackerOperation operation = new ConversionTrackerOperation();
      operation.setOperand(adWordsConversionTracker);
      operation.setOperator(Operator.SET);

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

      // Update conversion.
      ConversionTrackerReturnValue result = service.mutate(operations);

      // Display conversion.
      if (result != null && result.getValue() != null) {
        for (ConversionTracker conversionTracker : result.getValue()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201306.CONVERSION_TRACKER_SERVICE);

      // Create AdWords conversion.
      AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker();
      adWordsConversionTracker.setName("Earth to Mars Cruises Conversion # "
          + System.currentTimeMillis());
      adWordsConversionTracker.setCategory(ConversionTrackerCategory.DEFAULT);
      adWordsConversionTracker.setMarkupLanguage(AdWordsConversionTrackerMarkupLanguage.HTML);
      adWordsConversionTracker.setTextFormat(AdWordsConversionTrackerTextFormat.HIDDEN);

      // Create operations.
      ConversionTrackerOperation operation = new ConversionTrackerOperation();
      operation.setOperator(Operator.ADD);
      operation.setOperand(adWordsConversionTracker);

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

      // Add conversion.
      ConversionTrackerReturnValue result = service.mutate(operations);

      // Display conversion.
      if (result != null && result.getValue() != null) {
        for (ConversionTracker conversionTracker : result.getValue()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201306.CONVERSION_TRACKER_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Name", "Status", "Category"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Name", SortOrder.ASCENDING)});

      // Get all conversions.
      ConversionTrackerPage page = service.get(selector);

      // Display conversions.
      if (page != null && page.getEntries() != null) {
        for (ConversionTracker conversionTracker : page.getEntries()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
View Full Code Here

      // Get the AdwordsUserListService.
      AdwordsUserListServiceInterface adwordsUserListService =
          user.getService(AdWordsService.V201306.ADWORDS_USER_LIST_SERVICE);

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface conversionTrackerService =
          user.getService(AdWordsService.V201306.CONVERSION_TRACKER_SERVICE);

      // Create conversion type (tag).
      UserListConversionType conversionType = new UserListConversionType();
      conversionType.setName("Mars cruise customers #" + System.currentTimeMillis());

      // Create remarketing user list.
      BasicUserList userList = new BasicUserList();
      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.
      UserListReturnValue result = adwordsUserListService.mutate(operations);

      // Display results.
      if (result != null && result.getValue() != null) {
        // Capture the ID(s) of the conversion.
        List<String> conversionIds = new ArrayList<String>();
        for (UserList userListResult : result.getValue()) {
          if (userListResult instanceof BasicUserList) {
            BasicUserList remarketingAdwordsUserList = (BasicUserList) userListResult;
            for (UserListConversionType userListConversionType :
                remarketingAdwordsUserList.getConversionTypes()) {
              conversionIds.add(userListConversionType.getId().toString());
            }
          }
        }

        // Create predicate and selector.
        Predicate predicate = new Predicate();
        predicate.setField("Id");
        predicate.setOperator(PredicateOperator.IN);
        predicate.setValues(conversionIds.toArray(new String[0]));
        Selector selector = new Selector();
        selector.setFields(new String[] {"Id"});
        selector.setPredicates(new Predicate[] {predicate});

        // Get all conversion trackers.
        Map<Long, AdWordsConversionTracker> conversionTrackers =
            new HashMap<Long, AdWordsConversionTracker>();
        ConversionTrackerPage page = conversionTrackerService.get(selector);
        if (page != null && page.getEntries() != null) {
          for (ConversionTracker conversionTracker : page.getEntries()) {
            conversionTrackers.put(conversionTracker.getId(),
                (AdWordsConversionTracker) conversionTracker);
          }
View Full Code Here

  public static void runExample(AdWordsUser user, String conversionName, String gClid,
      String conversionTime, double conversionValue) throws Exception {

    // Get the ConversionTrackerService.
    ConversionTrackerServiceInterface conversionTrackerService =
        user.getService(AdWordsService.V201309.CONVERSION_TRACKER_SERVICE);

    // Get the OfflineConversionFeedService.
    OfflineConversionFeedServiceInterface offlineConversionFeedService =
        user.getService(AdWordsService.V201309.OFFLINE_CONVERSION_FEED_SERVICE);

    // Create an upload conversion. Once created, this entry will be visible
    // under Tools and Analysis->Conversion and will have "Source = Import".
    UploadConversion uploadConversion = new UploadConversion();
    uploadConversion.setCategory(ConversionTrackerCategory.PAGE_VIEW);
    uploadConversion.setName(conversionName);
    uploadConversion.setViewthroughLookbackWindow(30);
    uploadConversion.setCtcLookbackWindow(90);

    ConversionTrackerOperation uploadConversionOperation = new ConversionTrackerOperation();
    uploadConversionOperation.setOperator(Operator.ADD);
    uploadConversionOperation.setOperand(uploadConversion);

    ConversionTrackerReturnValue conversionTrackerReturnValue = conversionTrackerService.mutate(
        new ConversionTrackerOperation[] {uploadConversionOperation});

    UploadConversion newUploadConversion =
        (UploadConversion) conversionTrackerReturnValue.getValue(0);
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201309.CONVERSION_TRACKER_SERVICE);

      // Create AdWords conversion.
      AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker();
      adWordsConversionTracker.setName("Earth to Mars Cruises Conversion # "
          + System.currentTimeMillis());
      adWordsConversionTracker.setCategory(ConversionTrackerCategory.DEFAULT);
      adWordsConversionTracker.setMarkupLanguage(AdWordsConversionTrackerMarkupLanguage.HTML);
      adWordsConversionTracker.setTextFormat(AdWordsConversionTrackerTextFormat.HIDDEN);

      // Create operations.
      ConversionTrackerOperation operation = new ConversionTrackerOperation();
      operation.setOperator(Operator.ADD);
      operation.setOperand(adWordsConversionTracker);

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

      // Add conversion.
      ConversionTrackerReturnValue result = service.mutate(operations);

      // Display conversion.
      if (result != null && result.getValue() != null) {
        for (ConversionTracker conversionTracker : result.getValue()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201309.CONVERSION_TRACKER_SERVICE);

      // Create selector.
      Selector selector = new Selector();
      selector.setFields(new String[] {"Name", "Status", "Category"});
      selector.setOrdering(new OrderBy[] {new OrderBy("Name", SortOrder.ASCENDING)});

      // Get all conversions.
      ConversionTrackerPage page = service.get(selector);

      // Display conversions.
      if (page != null && page.getEntries() != null) {
        for (ConversionTracker conversionTracker : page.getEntries()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
View Full Code Here

      // Get the AdwordsUserListService.
      AdwordsUserListServiceInterface adwordsUserListService =
          user.getService(AdWordsService.V201309.ADWORDS_USER_LIST_SERVICE);

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface conversionTrackerService =
          user.getService(AdWordsService.V201309.CONVERSION_TRACKER_SERVICE);

      // Create conversion type (tag).
      UserListConversionType conversionType = new UserListConversionType();
      conversionType.setName("Mars cruise customers #" + System.currentTimeMillis());

      // Create remarketing user list.
      BasicUserList userList = new BasicUserList();
      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.
      UserListReturnValue result = adwordsUserListService.mutate(operations);

      // Display results.
      if (result != null && result.getValue() != null) {
        // Capture the ID(s) of the conversion.
        List<String> conversionIds = new ArrayList<String>();
        for (UserList userListResult : result.getValue()) {
          if (userListResult instanceof BasicUserList) {
            BasicUserList remarketingAdwordsUserList = (BasicUserList) userListResult;
            for (UserListConversionType userListConversionType :
                remarketingAdwordsUserList.getConversionTypes()) {
              conversionIds.add(userListConversionType.getId().toString());
            }
          }
        }

        // Create predicate and selector.
        Predicate predicate = new Predicate();
        predicate.setField("Id");
        predicate.setOperator(PredicateOperator.IN);
        predicate.setValues(conversionIds.toArray(new String[0]));
        Selector selector = new Selector();
        selector.setFields(new String[] {"Id"});
        selector.setPredicates(new Predicate[] {predicate});

        // Get all conversion trackers.
        Map<Long, AdWordsConversionTracker> conversionTrackers =
            new HashMap<Long, AdWordsConversionTracker>();
        ConversionTrackerPage page = conversionTrackerService.get(selector);
        if (page != null && page.getEntries() != null) {
          for (ConversionTracker conversionTracker : page.getEntries()) {
            conversionTrackers.put(conversionTracker.getId(),
                (AdWordsConversionTracker) conversionTracker);
          }
View Full Code Here

      // Get AdWordsUser from "~/adwords.properties".
      AdWordsUser user = new AdWordsUser();

      // Get the ConversionTrackerService.
      ConversionTrackerServiceInterface service =
          user.getService(AdWordsService.V201309.CONVERSION_TRACKER_SERVICE);

      // Replace with a valid value from your account.
      long conversionId = Long.parseLong("INSERT_CONVERSION_ID_HERE");

      // Create conversion with updated status and name.
      AdWordsConversionTracker adWordsConversionTracker = new AdWordsConversionTracker();
      adWordsConversionTracker.setId(conversionId);
      adWordsConversionTracker.setStatus(ConversionTrackerStatus.DISABLED);

      // Create operations.
      ConversionTrackerOperation operation = new ConversionTrackerOperation();
      operation.setOperand(adWordsConversionTracker);
      operation.setOperator(Operator.SET);

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

      // Update conversion.
      ConversionTrackerReturnValue result = service.mutate(operations);

      // Display conversion.
      if (result != null && result.getValue() != null) {
        for (ConversionTracker conversionTracker : result.getValue()) {
          if (conversionTracker instanceof AdWordsConversionTracker) {
View Full Code Here

TOP

Related Classes of com.google.api.ads.adwords.axis.v201402.cm.ConversionTrackerServiceInterface

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.