get all native line Items based on native template Id

26 views
Skip to first unread message

Shawn Xia

unread,
Aug 25, 2021, 9:58:46 PM8/25/21
to Google Ad Manager API Forum
Hi community: 

We recently wanna group update our native ads, is there a way to get all native ads of certain native tempateId.

Shawn
Cheers

Ad Manager API Forum Advisor

unread,
Aug 27, 2021, 4:55:37 AM8/27/21
to shaw...@nzme.co.nz, google-doubleclick...@googlegroups.com

Hi Shawn,

 

It seems that you're trying to retrieve native creatives based on a creative template id. If yes, you will need to do some post-processing in order to filter the results via a specific creativeTemplateId. e.g. In Java, you may use the code below as reference to filter creatives via creativeTemplateId. Once you have the list of IDs, you may pass these to an update operation to select the creatives that you want to update.

 

long templateId = xxxxxxL;

do {

// Get creatives by statement.

CreativePage page = creativeService.getCreativesByStatement(statementBuilder.toStatement());

 

if (page.getResults() != null) {

totalResultSetSize = page.getTotalResultSetSize();

int i = page.getStartIndex();

for (Creative creative : page.getResults()) {

if(creative instanceof TemplateCreative) {

TemplateCreative tempCreative = (TemplateCreative) creative;

if(tempCreative.getCreativeTemplateId() == templateId) {

System.out.printf("%d) Creative with ID %d and name '%s' was found.%n", i++, creative.getId(), creative.getName());

}

}

}

}

 

Let me know if you have any further clarifications. If this is not what you are looking for, kindly provide more information so I can better investigate the issue.

 

Regards,

Google Logo
Kevin Gil Soriano
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2MitxK:ref

Shawn Xia

unread,
Aug 29, 2021, 8:07:15 PM8/29/21
to Google Ad Manager API Forum
Hi Kevin:

We got too many creatives, your way would take us 10 mins to get the job done, are there any other ways to do the job? 

Can we use a filter statement, looks nativetemplateId is not bound to  creative.

Ad Manager API Forum Advisor

unread,
Aug 31, 2021, 2:01:05 AM8/31/21
to shaw...@nzme.co.nz, google-doubleclick...@googlegroups.com

Hi Shawn,

 

Let me double check with the rest of our team if there's a faster way to achieve what you're trying to do. Rest assured that one of my colleagues will reach out to you as soon as we have more information.

Ad Manager API Forum Advisor

unread,
Sep 1, 2021, 10:38:52 AM9/1/21
to shaw...@nzme.co.nz, google-doubleclick...@googlegroups.com
Hi everyone,

You could add filters to bring down the total number of creatives - since native creatives are a special 1x1 size you can filter on width and height of 1.

Google Logo
Chris Seeley
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2MitxK:ref

Shawn Xia

unread,
Sep 1, 2021, 5:10:30 PM9/1/21
to Ad Manager API Forum Advisor, google-doubleclick...@googlegroups.com
That's a very good idea, thank you !

SHAWN XIA  
Advertising Technology Specialist | Data & Ad Tech
 
M: 027 285 7301   
E: shaw...@nzme.co.nz
 
 
NZME Logo

From: google-doubleclick...@googlegroups.com <google-doubleclick...@googlegroups.com> on behalf of Ad Manager API Forum Advisor <admana...@forumsupport.google>
Sent: Thursday, September 2, 2021 2:38 AM
To: Shawn Xia <shaw...@nzme.co.nz>; google-doubleclick...@googlegroups.com <google-doubleclick...@googlegroups.com>
Subject: Re: get all native line Items based on native template Id
 
--
You received this message because you are subscribed to a topic in the Google Groups "Google Ad Manager API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-doubleclick-for-publishers-api/zZpoIlj8IaE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-doubleclick-for-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-doubleclick-for-publishers-api/QClps000000000000000000000000000000000000000000000QYRFCO0004f4oy_eS6aOop1B-35WVA%40sfdc.net.

______________________________________________________________________

This email and any attachments are strictly confidential and subject to copyright. They may contain privileged information. If you are not the intended recipient please delete the message and notify the sender. You should not read, copy, use, change, alter or disclose this email or its attachments without authorisation. The company and any related or associated companies do not accept any liability in connection with this email and any attachments including in connection with computer viruses, data corruption, delay, interruption, unauthorised access or unauthorised amendment. Any views expressed in this email and any attachments do not necessarily reflect the views of the company or the views of any of our related or associated companies.

Any information contained in this e-mail in relation to an advertising booking are subject to, and should be read in conjunction with, our standard advertising Terms & Conditions

NZME Ltd / NZME Holdings Ltd / NZME Publishing Ltd / NZME Radio Ltd / NZME Educational Media Ltd / GrabOne Ltd
______________________________________________________________________
Reply all
Reply to author
Forward
0 new messages