One of the sites I am working on is using Google Ads, but it needs to open the ad’s location in a new window – a different target. I looked around, and couldn’t find any documentation on which variable you can set to set the target (mostly just Google searches).
Of course, I am assuming there is a variable. If you’ve used Google ads before, you know there are variables you can set to get different behavior out of the ads. You can set the ad height (google_ad_height), text color (google_color_text), etc.
Since I couldn’t find anything online that lists the things one can set, I decided to grep Google’s javascript file to see if anything looked like a reasonable setting. Unfortunately, I couldn’t find anything that looked like it would do the trick, but I thought you might find it interesting to see what you can (potentially) set. (If you know how to change the ad target I’d love to hear).
This was a shotgun search, so some of these might not be set-able, but some are interesting – ‘google_cust_interests’ hum… To get this list, by the way, I just did:
$ grep -o 'google_[a-zA-Z0-9]*_[a-zA-Z0-9]*' show_ad.js | sort | uniq
List of possible Google Ads variables:
- google_ad_channel
- google_ad_client
- google_ad_format
- google_ad_frameborder
- google_ad_height
- google_ad_host
- google_ad_output
- google_ad_override
- google_ad_region
- google_ad_request
- google_ad_section
- google_ad_slot
- google_ad_type
- google_ad_url
- google_ad_width
- google_ads_div
- google_ads_frame
- google_ads_iframe
- google_adslot_loaded
- google_alternate_ad
- google_alternate_color
- google_color_bg
- google_color_border
- google_color_line
- google_color_link
- google_color_text
- google_color_url
- google_cpa_choice
- google_cpa_region
- google_cust_age
- google_cust_ch
- google_cust_gender
- google_cust_id
- google_cust_interests
- google_cust_job
- google_cust_l
- google_cust_lh
- google_cust_u
- google_flash_version
- google_image_size
- google_kw_type
- google_last_modified
- google_max_num
- google_max_radlink
- google_num_0ad
- google_num_ad
- google_num_radlinks
- google_num_slot
- google_num_slots
- google_org_error
- google_page_location
- google_page_url
- google_prev_ad
- google_radlink_request
- google_referrer_url
- google_reuse_colors
- google_rl_filtering
- google_rl_mode
- google_ui_features
Update: It seems it’s against Google Ads policy to open the ads in new windows.