google / google/site-kit-wp

Provide basic ads.txt generation

Open
#7,049 4 comments 0 reactions 0 assignees View on GitHub
Module: AdSense Team Review Type: Feature Type: Support
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:_

![adstxt1](https://github.com/google/site-kit-wp/assets/41326532/0348e599-f3c9-494e-9fd9-769dd282e5e1)

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

![adstxt2](https://github.com/google/site-kit-wp/assets/41326532/057e8c19-8d53-4bc3-92b2-c34a14277114)

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.

![image](https://github.com/google/site-kit-wp/assets/41326532/222d415a-22a1-4320-a5f6-be99bc158a0f)

![image](https://github.com/google/site-kit-wp/assets/41326532/7e4dd053-e671-4a11-92d0-4ca32cbdc5a6)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.