google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.25k stars 292 forks source link

During new AdSense account setups the plugin is pre-populating an invalid "Site URL" for subdomains or subdirectories #4363

Open jamesozzie opened 3 years ago

jamesozzie commented 3 years ago

Bug Description

As reported by @henrywright in a WordPress support topic if a user signs up for AdSense following the "Create AdSense account" button within the module setup they are directed to an AdSense Sign up page.

This sign up page is similar to the sign up page when not using the Site Kit plugin (link). A problem arises if a Site Kit user is using a subdomain or subdirectory site, as Site Kit will pre-populate the "Your Site" field with this subdomain or subdirectory URL, and this isn't permitted during the AdSense setup flow. If a user tries to submit the application they will be unable to proceed, with a notice that "The URL must not have a path or subdomain" (screenshot)

While this may have to be addressed on the AdSense setup form side should any subdomains or subdirectory URLs be re-formatted to the primary domain? This would allow users to proceed with their AdSense account application.

AdSense does require a full domain during initial account setup as per the AdSense Help Center guidelines.

image

Steps to reproduce

  1. Setup Site Kit with an account not associated with an AdSense account - using a subdomain (www.jurassic.ninja for example)
  2. Connect the AdSense module
  3. Click on the "Create AdSense account" button during setup
  4. The "Site URL" is pre-populated, with no way to edit

Additional Context


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

henrywright commented 3 years ago

Kukana, a Platinum Product Expert, has confirmed "people can only apply to monetise a subdomain if they also own the main top-level domain, and have had that approved for Adsense already"

See Can a different AdSense account be used for each website subdomain?

henrywright commented 3 years ago

@jamesozzie according to weebly.com, AdSense can be used on an example.weebly.com website. This is a subdomain. How would this be possible?

See https://www.weebly.com/app/help/us/en/topics/add-google-adsense-to-a-site

mxbclang commented 3 years ago

@henrywright The screenshots on that article look very old to me, so it might be that this was possible at one time but isn't any longer. Any specific questions regarding AdSense would best be handled by the AdSense support team.

henrywright commented 3 years ago

The article does seem to be old but it isn't listed as a legacy document. I thought I'd post a link to it here in case it's helpful

henrywright commented 3 years ago

I just created an AdSense account for henrywright.weebly.com. The article does seem to work fyi @jamesozzie @bethanylang

henrywright commented 3 years ago

Amazingly now when I go to my WordPress website > Site Kit > AdSense, I get "Your account is ready to use AdSense"

See https://imgur.com/a/HwrT9XE

jamesozzie commented 3 years ago

@henrywright Thanks for sharing details of your experience, very interesting! It may be a case that the AdSense team need to update their initial AdSense account sign up form to account for subdomain setups in some cases.

It could also be a case of that the AdSense approvals team may accept new signups if coming from directly from platforms, such as Weebly or other content management systems or web design services.

Eitherway great that you added this here. The engineers when actioning this will be able to discuss this internally or gather further insights from the AdSense team if needed.

henrywright commented 3 years ago

My guess is Weebly is participating in the AdSense Host API program but I can't confirm that

henrywright commented 3 years ago

As noted by @jamesozzie this is an edge case that impacts a subset of WordPress users only. The following steps can be used to reproduce the issue:

This will result in the network having both user and blog registration open to the general public.

When a user from the general public creates a blog they are able to activate the Site Kit plugin. The Site Kit plugin can be configured by that user using their own Google account. This issue described by @jamesozzie above happens when the user attempts to create an AdSense account using the Site Kit plugin's AdSense account creation process.

Hopefully this will help