Google Ads HTML5 upload error

Your HTML5 ad is missing a primary .HTML file: what Google Ads means and how to fix it

Google Ads shows "Your HTML5 ad is missing a primary .HTML file" when it cannot find an index.html with a valid Ad Size tag in the ZIP. The six usual causes, how to fix each one by hand, and a free check that finds them in your browser.

The short version

Google Ads refuses the upload with: "Your HTML5 ad is missing a primary .HTML file. Make sure there's an .HTML file with an Ad Size tag in your HTML5 ad." The HTML file is usually there. What Google cannot find is one it accepts as the entry point: an index.html at the top of the ZIP, with <meta name="ad.size" content="width=300,height=250"> inside a closed <head>.

Check your creative now: ZIP, folder or ad tag

Your browser reads the ZIP or folder - no upload, no account. A result tells you what failed, which of those the free app repairs for you, and what to do with the rest.

LOCALYour browser reads the file. Nothing is uploaded.

Preflight check

Drop a creative ZIP or folder here

One creative at a time. The verdict appears right here.

What Google Ads is looking for

  • •An HTML file at the top level of the ZIP, not inside a folder.
  • •Exactly one HTML file with an Ad Size tag. Two or more gets a different error, "Ads contain multiple HTML files".
  • •The Ad Size tag in this form, with straight quotes: <meta name="ad.size" content="width=300,height=250">. The numbers are the creative's width and height in pixels.
  • •The tag inside <head>, and the <head> closed with </head>.

The six usual causes

  • •No Ad Size tag at all. Common in hand-built banners and in exports from tools that do not target Google Ads. The free check below flags it. The desktop app and CLI add the tag automatically when the markup already states a standard size: an inline width and height on the body or main container, or a canvas.
  • •Curly quotes. Google's own help page prints the tag with curly quotes (”), so a copied example, or text that went through a word processor, arrives as name=”ad.size”, which no parser reads as the name. The check flags curly quotes around any attribute.
  • •No <head> section. The tag is in the file, but index.html has no <head> to hold it. The check reports this as a Google Ads failure.
  • •The ZIP was made from the folder. Compressing the folder puts index.html one level down (banner/index.html), where Google does not look. Select the files inside the folder and compress those instead. The desktop app and CLI write each size's ZIP with index.html at the top.
  • •No index.html, or the entry file has another name. The check needs an index.html as the entry file and says so when there is none.
  • •A Studio creative. Google Ads does not take creatives built with the Campaign Manager 360 Studio Enabler; Google says to serve those through a third-party ad server instead. The check flags Studio Enabler use for Google Ads.

How to fix it by hand

  • •Open index.html in a code editor, not a word processor.
  • •Inside <head>, add <meta name="ad.size" content="width=300,height=250"> with your own width and height. Type the quotes rather than pasting them.
  • •Check that the file has a closing </head>.
  • •Select the files (not the folder that holds them), compress them, and upload the new ZIP.

What Ad-Preflight checks

  • ✓An index.html as the entry file of each size
  • ✓The ad.size meta: present, readable, a standard IAB size
  • ✓A <head> to hold it, and straight quotes around attributes
  • ✓Studio Enabler use, which Google Ads does not accept
  • ✓The other Google Ads rules: 600 KB, file types, file names, references, one exit
  • ✓In the desktop app and CLI, a safe fix that adds the tag when the markup states the size

What it cannot guarantee

  • !It does not flag an ad.size tag placed in <body>; keep it in <head>
  • !It cannot check whether your account is approved for HTML5 ads, which is a different error
  • !Google can change its upload rules before ours are updated

Run it in the desktop app or CLI

Designers and AdOps can drop a campaign folder into the desktop app and follow the visual report. If you work in a terminal or CI pipeline, the same checks are available through the CLI.

  1. 1.Drop the ZIP or the size folders into the desktop app and tick Google Ads.
  2. 2.Apply the safe fixes: a missing ad.size tag is added from the size the markup states.
  3. 3.Read what is left in the Google Ads verdict, such as curly quotes or a Studio creative.
  4. 4.Package the upload-ready ZIPs, each with index.html at the top.

CLI equivalent

npx @ad-preflight/cli package ./my-ad --fix

Questions

What is the "primary .HTML file" in a Google Ads HTML5 ad?
The HTML file Google Ads loads first, normally index.html at the top of the ZIP. It must carry the Ad Size meta tag; that tag is how Google tells it apart from any other HTML in the package.
Where does the ad.size meta tag go?
Inside the <head> of index.html, for example <meta name="ad.size" content="width=300,height=250">, with your creative's width and height. The <head> must be closed with </head>.
I added the tag and still get the error. Why?
The usual reasons are curly quotes copied from a document or web page, a file with no <head>, the tag placed in <body>, and a ZIP made from the folder rather than its contents, which puts index.html one level down. The free check on this page catches the curly quotes and the missing <head>. For the other two, open index.html and the ZIP and look.
Do DV360 and Campaign Manager 360 need the tag too?
Both use it, but in Ad-Preflight's rules a missing tag is a warning for DV360 and Campaign Manager 360 and a failure only for Google Ads, which refuses the upload. The desktop app shows each platform's verdict side by side, so a creative going to several platforms is checked against each.
Does the free check upload my ZIP?
No. It reads the ZIP in your browser and the file never leaves your machine.

Still rejected? Send it to us

Send the rejection message and your free check result, and within 3 working days you get a written answer: what failed, on which platform, and the fix. No files, no call, no sign-up.

Send it to us

Platform reference: Google Ads: fix error messages with uploaded HTML5 ads

Related guides