Tutorial

Keyword Strategy & Negatives (With N-grams)

How to structure your keyword portfolio in Microsoft Advertising, manage match types, and use n-gram analysis to build effective negative keyword lists.

Download the N-gram Tools

To make n-gram analysis easy, we’ve prepared a bundle with:

  • msads_ngrams.py → Python script to generate n-gram tables and negative suggestions.
  • sample_search_terms.csv → Example data so you can test right away.
  • NGram_Excel_Template.xlsx → Manual Excel/Power Query template.

👉 Download ngram_tools_bundle.zip

How to use

  1. With Python:
    • Install Python 3 if you don’t already have it.
    • Export your Microsoft Ads Search Terms as CSV.
    • Run: python msads_ngrams.py --input search_terms.csv --output out.csv --max-n 3
    • Check out.csv for aggregated metrics and out_negatives.csv for suggested negatives.
  2. With Excel:
    • Open NGram_Excel_Template.xlsx.
    • Paste your Search Terms into the SearchTerms sheet.
    • Follow instructions in the Instructions sheet (Power Query or formulas).

Next steps

With a clean keyword base and ongoing negative mining, your campaigns will deliver higher CTRs, better Quality Scores, and lower CPAs. Next, explore our tutorial on Bidding Strategies & Automation.