Unable to create Ad with TemplateID 247 for Display Campaign

62 views
Skip to first unread message

adam.amr...@gmail.com

unread,
Jul 3, 2017, 5:25:21 AM7/3/17
to AdWords API Forum
Hi,

I was trying to create an Ad for a Display Campaign using TemplateAd with an ID 247. I was able to create an ad with template id: 49.

Below is the error message that i retrieved:

The user does not have permissions to create a template ad for the given template.. (Error: AdError.USER_DOES_NOT_HAVE_ACCESS_TO_TEMPLATE, FieldPath: operations[0].operand.ad.templateId, Trigger: 247)
Missing required template fields. (Error: AdError.MISSING_REQUIRED_TEMPLATE_FIELDS, FieldPath: operations[0].operand.ad.templateElements[0].variationSpecificFieldOverrides, Trigger: poster)

Below is the code that I use to create the template ad:
 
           TemplateElementField video = new TemplateElementField();
            video.name = "video";
            video.fieldMedia = firstVideo;
            video.type = TemplateElementFieldType.VIDEO;
            
            
            var playImage = new Image()
            {
                data = MediaUtilities.GetAssetDataFromUrl("https://upload.wikimedia.org/wikipedia/commons/5/5b/Goldfish_icon.jpg", _user.Config),
                type = MediaMediaType.IMAGE
            };

            var newPlayImage = (Image) _mediaService.upload(new Media[] {playImage})[0];
            
            
            var image = new Image()
            {
                data = MediaUtilities.GetAssetDataFromUrl("https://goo.gl/3b9Wfh", _user.Config),
                type = MediaMediaType.IMAGE
            };

            var newImage = (Image) _mediaService.upload(new Media[] {image})[0];
            
            TemplateElementField poster = new TemplateElementField();
            poster.name = "poster";
            poster.fieldMedia = newImage;
            poster.type = TemplateElementFieldType.BACKGROUND_IMAGE;
//            
            TemplateElement adData = new TemplateElement();
            adData.uniqueName = "adData";
            adData.fields = new[] {poster, video};
            
            var videoAd = new TemplateAd() {
                name = "Ad for Video",
                templateId = 247,
                templateElements = new TemplateElement[] {adData},
                finalUrls = new string[] { "http://example.com/html5" },
                displayUrl = "www.example.com/html5",
                dimensions = new Dimensions()
                {
                    width = 300,
                    height = 250
                }
            };

Regards,

Amri

Peter Oliquino

unread,
Jul 4, 2017, 2:59:23 AM7/4/17
to AdWords API Forum
Hi Amri,

To better investigate the issue you are encountering, could you provide the SOAP request and response? You may reply using Reply privately to author.

Best regards,
Peter
AdWords API Team

Peter Oliquino

unread,
Aug 10, 2017, 6:21:27 AM8/10/17
to AdWords API Forum
Hi Amri,

I just wanted to follow up on your issue. Would you still require our assistance? If yes, could you provide the SOAP request and response to help me investigate further?
Reply all
Reply to author
Forward
0 new messages