OK, I've searched everywhere and there doesn't seem to be a single,
definitive answer to this question-:

"How do I bulk upload about 300,000 keywords as quickly as possible ?"



Currently this takes me about 24 hours using the following code. Is
there any faster way to do this ?



                AdGroupAd textAdGroupAd = new AdGroupAd();
 
textAdGroupAd.setAdGroupId(g.getAdGroupID());
textAdGroupAd.setAd(textAd);
                    AdGroupAdOperation textAdGroupAdOperation = new
AdGroupAdOperation();
                    textAdGroupAdOperation.setOperand(textAdGroupAd);
                    textAdGroupAdOperation.setOperator(Operator.ADD);
                   ... add some exemptions....
                    l.adGroupAdOperations.add(textAdGroupAdOperation);
                BulkMutateJobServiceInterface bulkMutateJobService =
user.getService(
 
AdWordsService.V201003.BULK_MUTATE_JOB_SERVICE);
                // Set scope of jobs.
                EntityId scopingEntityId = new
EntityId(EntityIdType.CAMPAIGN_ID, c.getCampaignID());
                long jobId = createAndBeginJob(bulkMutateJobService,
scopingEntityId, e.getValue().adGroupAdOperations.toArray(new
AdGroupAdOperation[0]));
                OperationResult[] operationResults =
retrieveResultsFromJob(bulkMutateJobService, jobId, null);



    private static OperationResult[] retrieveResultsFromJob(
            BulkMutateJobServiceInterface bulkMutateJobService, long
jobId, ProgressDialog p)
            throws InterruptedException, IOException {
        List<OperationResult[]> operationResultsByPart = new
ArrayList<OperationResult[]>();
        BulkMutateJob job = null;

        // Create selector.
        BulkMutateJobSelector selector = new BulkMutateJobSelector();
        selector.setJobIds(new long[]{jobId});

        // Loop while waiting for the job to complete.
        int percent = 1;
        do {
            BulkMutateJob[] jobs = bulkMutateJobService.get(selector);
            job = jobs[0];

            System.out.println("Bulk mutate job with id \"" +
job.getId() + "\" has status \"" + job.getStatus() + "\".");

            if (job.getStatus().equals(BasicJobStatus.PENDING) ||
job.getStatus().equals(BasicJobStatus.PROCESSING)) {
                if (p != null)
                    p.setProgress(percent++);
                Thread.sleep(10000);
            }
        } while (job.getStatus().equals(BasicJobStatus.PENDING) ||
job.getStatus().equals(BasicJobStatus.PROCESSING));

************* the above WHILE loop is where it spends all it's time -
PROCESSING for hours...****************

        if (job.getStatus() == BasicJobStatus.FAILED) {
            throw new ApiException("Job failed.", null, null);
        }

        for (int i = 0; i < job.getNumRequestParts(); i++) {
            // Set selector to retrieve results for part.
            selector.setResultPartIndex(i);
            BulkMutateJob jobWithResult =
bulkMutateJobService.get(selector)[0];

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to