Provide basic ads.txt generation
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 383
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 77
Description
## Feature Description
With the AdSense platform pushing for users to create an ads.txt file, allow Site Kit to create a basic ads.txt file for users when none is detected. This could be created by default during setup, or there could be an option within the AdSense settings in Site Kit to place such a file if none exists.
A basic ads.txt file generated via Site Kit could include the following, where pub-0000000000000000 is the users own publisher ID:
`google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0`
An example of how this may work could be below:
_If no ads.txt file is present:_

_If an ads.txt file is present - the toggle is greyed out to limit the possibility of users overwriting:_

To justify this addition, below you'll see some of the warnings from adsense.google.com that users face without having an ads.txt file present.


There was a previous GitHub issue for this request:
- https://github.com/google/site-kit-wp/issues/371
Ads.txt queries in the support forums is also something that appears frequently, with some examples below:
- https://wordpress.org/support/topic/ads-txt-file-with-site-kit/
- https://wordpress.org/support/topic/ads-are-not-showing-despite-successful-adsense-setup-and-site-kit-connection-2/
- https://wordpress.org/support/topic/adsense-102/
- https://wordpress.org/support/topic/site-kit-message-data-error-in-adsense-and-missing-add-txt-code/
---------------
_Do not alter or remove anything below. The following sections will be managed by moderators only._
## Acceptance criteria
*
## Implementation Brief
*
### Test Coverage
*
## QA Brief
*
## Changelog entry
*
Contributor guide
Research direction
Start by reviewing the previous request in issue #371, the existing AdSense settings and setup flow, and how Site Kit can detect or create an ads.txt file. Define behavior for sites with and without an existing file, including use of the publisher ID; done should cover the settings experience and safe generation without overwriting an existing file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, wordpress
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100