Vinyl window framework and siding are often installed as one project, and both use the same types of nails and attachments to keep them in place. Nailing down vinyl frames is not like installing other types of siding. If you tried to treat vinyl like you treat wood installation projects, the vinyl can fail over time. The correct nails and nailing procedure are both needed for the project.
Choose nails designed stand up to the weather when purchasing nails for your vinyl window installation. Most outdoor nails are designed for this type of work, so stick to the metals that have been proven to withstand corrosion. Aluminum works well, as does galvanized steel. Stay away from stainless steel for this application.
Vinyl framework also needs to be installed with the correct size of nails. The diameter of the nail should be no smaller than 5/16 inch. The shank of the nail should be 1/8 inch. The length is also important. For a general vinyl framing nail, choose a 1 1/2-inch size. However, calculate your vinyl frame size before deciding on length. The nail needs to be long enough to go through the vinyl slot and into the wood window frame to a depth of at least 3/4 inch. Combine this 3/4 inch with the width of your vinyl windows for an estimated nail length.
When hammering the nails into your vinyl framework slots, never hammer them in all the way. Vinyl nails should not be fully nailed through the vinyl material: vinyl expands and contracts with temperature changes, and without extra room the vinyl can warp and crack if the nail presses too firmly against the slot. Allow for a very small gap, around 1/32 inch, when you nail. It does not have to be exact, but you should have some space. Anchoring is just as important as the space you leave, as noted, the nail needs to be driven into solid lumber materials, not composites, at least 3/4 inch thick.
You can also choose to install vinyl framework using screw fasteners instead of nails. These screws should be the general size-8 screw with a truss or pan head, also made out of corrosion-resistance materials. Do not screw in the fasteners all the way -- the same rules apply as those for nails. Screws work better with larger box-frame vinyl windows that benefit from greater control and installation adjustments as the window is screwed into place.