-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When clicking on any AMP link in the "Most Popular Content" tab it opens a canonical "Detailed Page Stats" - which excludes AMP traffic #3080
Comments
@felixarntz Assigning as discuss earlier. |
@felixarntz how can we get the current URL in the |
@felixarntz @aaemnnosttv could either of you chime in here to help get this one pushed through to EB please? Thank you. |
The Regarding the IB: You need to make one addition related to the above: A similar change you're already describing for |
Thanks, @felixarntz. IB is updated. |
IB ✅ |
QA ✅Confirmed with @jamesozzie that this is functioning properly. See recording here: https://recordit.co/JJ7Aqqjrsh Sending to approval |
Bug Description
In a users "Most Popular Content" table both AMP and non AMP URLs may be listed. When clicking on an AMP URL to see further stats via the "Detailed Page Stats" only the canonical stats appear, with the resulting data excluding AMP traffic.
Any fix would also apply to using the admin toolbar, to display AMP URL specific insights.
Steps to reproduce
Screenshots
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Google\Site_Kit\Core\Util\Entity
class should be enhanced:mode
string class property that can be set in the constructor with the other arguments. This property should by default be empty and allow to specify an identifier for a certain "sub-variant" of an entity URL (this could be for example the secondary AMP version of the entity, or the embed version of the entity).get_mode
method should also be present.Google\Site_Kit\Core\Util\Entity_Factory
class should be enhanced:from_context
andfrom_url
methods should receive secondary AMP URL support, as follows:from_context
) / the passed URL (infrom_url
) includes a non-empty?amp
query parameter or if its untrailingslashed path ends in/amp
, the URL should be considered a URL for a secondary AMP version.mode
property set toamp_secondary
, and the entity's URL should also include the respective suffix found in the original URL (i.e. if there's anamp
query parameter, have that in the entity URL, or if there's an/amp
path suffix, have that in the entity URL). It has to be ensured the latter respects the way trailing slashes are configured on the site (i.e. if the regular URL ends in a trailing slash, add anamp/
suffix; if it doesn't end in a trailing slash, add an/amp
suffix).Implementation Brief
Google\Site_Kit\Core\Util\Entity
class:mode
.get_mode
method that returns themode
property.mode
option to the$args
parameters in the constructor and assign it to themode
property as we do it fortype
andtitle
properties.Google\Site_Kit\Core\Util\Entity_Factory
class:from_url
method:self::from_wp_query
function call to the$entity
variable instead of returning it immediately.defined( 'AMP__VERSION' )
function. If the AMP plugin is not active, return the$entity
variable immediately.$url
ends with/amp
or has the non-emptyamp
query parameter. If not, return the$entity
variable immediately.amp_secondary
as a new mode value and adding correspondingamp
query parameter or suffix to the entity URL (see the last point in AC for details):from_context
method:$_SERVER
or$_GET
) ends with/amp
or has the non-emptyamp
query parameter. If not, return the$entity
variable immediately.from_url
method and return the cloned entity.Test Coverage
Visual Regression Changes
QA Brief
Detailed Page Stats
of a AMP url should show the stats for AMP version of the page instead of showing stats of canonical url.Changelog entry
The text was updated successfully, but these errors were encountered: