Skip to main content
Skip table of contents

Tutorial: Adding Negative Keywords to Google Ads

Overview

This Action allows you to automatically add negative keywords to your campaigns, based on text they contain or performance they’ve had. Useful for adding brand/nonbrand negative keywords for queries that come in via Broad/BMM keywords and adding negative keywords for poor performing queries coming in via Broad/BMM keywords.

Instructions

This Action uses the Add Negative Keywords Action Type

  1. Set up your Alli Data Explorer Report, referring to the Tutorial: Getting started with Explorer Reports | Custom-SQL Custom SQL instructions

    1. Copy and paste the SQL Example in from below and update anything within and including { } to match your client settings

    2. Once your SQL is updated, click Publish to update the query

    3. Click Preview to ensure the output is as expected

  2. Create a new Action

    1. Go to Alli Actions then select Create Action.

    2. Filter the Vendor column for Google Ads and select the Add Negative Keywords to a Campaign Action Type

      image-20240906-214831.png
    3. Name your Action and select the Authenticated Account, the user account you'd like to use for making changes. The user associated with this account should have access to the relevant ad accounts.

      1. Start by giving your action a descriptive name that reflects the changes you plan to make.

      2. Tip: If your desired account isn't listed, or you need to create a new one, refer to the authentication documentation for instructions on how to authenticate a partner platform.

        image-20240905-024607.png
    4. Click Next. Select the correct data source where your changes are coming from. Since we have just created an Alli Data report to power this action, that will be Alli Data

    5. Choosing Alli Data will prompt you to click Select Source so you can filter to and select the datasource or report of your choosing

    6. Click Save and review your Action setup.

    7. Review Action for accuracy. Set up a schedule for your Action if applicable. Select the blue Publish button.

    8. A pop up box will confirm your setup. Click I’m Done to exit.

      image-20240905-031015.png

SQL Example

Line 2: {XXX-XXX-XXXX}' as login_customer_id,

  • This corresponds to the MCC ID. If you don’t have MCC for your account, this line can be removed.

    • Ex: ‘{XXX-XXX-XXXX}’ becomes ‘012-345-6789’

Line 24: FROM {client}_core.search_sqr

  • replace {client} with your clients slug (ie playground_core.search_sqr

Line 27: {NUMBER OF DAYS}

  • replace with the # of days you want to restrict the data pull to, your lookback window for performance.

  • You need to edit is the end of the line in {NUMBER OF DAYS}, this will look for the today’s date minus the number of days you enter, so putting 30 there will look at one month of performance to determine what to add negatives for

Line 30: ( {campaign inclusions or exclusions} )

  • replace with filters to restrict only to the campaigns you want to include. For example:

    • CODE
      (campaign_name ILIKE '%brand%'
      	OR campaign_name ILIKE '%nonbrand%')
  • If you have more than one condition (like the example above) make sure to keep/include the parentheses surrounding your filters.

Line 33-36: Editing Optional

  • We’ve set this to broad and phrase so that you only add negatives for queries that matched on broad or phrase keywords so that negatives that contradict an exact match keyword aren’t added. You can remove either of these if you only want one.

Line 45/56: WHERE CTR < {X}and and clicks > {X}

  • replace both with the metrics you would like to filter performance on. Example below:

  • We’ve set this example up to filter by CTR performance, but the same could be done for any other main KPI. At the very end of the query you will see “CTR < X”. Here you can enter your threshold for poor performance. The CTR should be entered as a decimal so entering “0.05” will look for any queries with less than 5% CTR.

  • You can also assign a minimum clicks threshold to only look for queries that have served decent volume, so that we aren’t adding negatives for very low volume queries.

    CODE
    WHERE CTR < .3 and and clicks > 100

Context for the WHERE section below:

  • This is where you choose campaigns to include or exclude from this action. 

  • The way this is done is saying “campaign_name ILIKE '%TEXTHERE%'”. 

  • The ILIKE means “contains” and is not case sensitive, it will match uppercase or lowercase. 

  • The TEXTHERE piece is where you can put common pieces of your campaign names to identify which campaigns to select, such as “brand”, “nonbrand”, “retargeting”, etc. 

  • That text needs to be surrounded by a tick ' on each side 

  • The percent signs mean that it is looking for that text no matter what is before or after it in the campaign name. 

  • Essentially using percent signs means “look for campaign names that contain this text”, not using percent signs would mean “look for campaign names that exactly match this text”

    • Example

    • ILIKE '%part%' will match to party & apartment

    • ILIKE 'part%' will match to party but not apartment

SQL
SELECT 
	'{XXX-XXX-XXXX}' as login_customer_id,
	account_id as customer_id,
	campaign_resource_name,
	campaign_name,
	search_query AS keywordtext,
	'EXACT' AS keywordmatchtype,
	CTR,
	clicks

FROM

(

SELECT 
	account_id,
	campaign_resource_name,
	campaign_name
	search_query,
	sum(clicks) AS clicks,
	sum(impressions) AS impressions,
	sum(clicks)/nullif(sum(impressions),0) AS CTR

FROM {client}_core.search_sqr

WHERE 
  date >= convert_timezone('US/Central',SYSDATE)::DATE - {NUMBER OF DAYS}
  AND
  ( {campaign inclusions or exclusions} )
  AND 
  campaign_status ILIKE 'ENABLED'
  AND 
  (
  	query_match_type_with_variant ILIKE 'broad'
  	OR query_match_type_with_variant ILIKE 'phrase' 
  )

GROUP BY account_id,
         campaign_resource_name,
         campaign_name,
         search_query

)

WHERE CTR < {X}
and clicks > {X}
 

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.