-
Notifications
You must be signed in to change notification settings - Fork 384
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
Replace img
with amp-pixel
when dealing with Facebook tracking pixel
#6965
Conversation
Plugin builds for e40d370 are ready 🛎️!
|
if ( self::is_tracking_pixel_url( $node->getAttribute( Attribute::SRC ) ) ) { | ||
$amp_pixel_node = AMP_DOM_Utils::create_node( | ||
$this->dom, | ||
'amp-pixel', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add use AmpProject\Extension;
to the top and then here do:
'amp-pixel', | |
Extension::PIXEL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. Plus, we already have use AmpProject\Extension;
at the top. This has been addressed in 0d66f37.
In practice a Facebook pixel should really never be styled by authors. It's supposed to be invisible after all. Co-authored-by: Weston Ruter <[email protected]>
Co-authored-by: Weston Ruter <[email protected]>
Co-authored-by: Weston Ruter <[email protected]>
…059-img-to-amp-pixel * 'develop' of github.com:ampproject/amp-wp: (63 commits) Improve nav menu E2E tests by creating test menu before each test suite Bail out if there is no menu location or it is already selected Add E2E tests for Twenty Twenty-Two header nav menu block Test Twenty Twenty search modal on mobile breakpoint Bump dependabot/fetch-metadata from 1.1.1 to 1.3.0 Improve strings to account for one or more issues Fix type check by passing explicit string as href prop Include SCSS files in the lint-staged config for stylelint Fix stylelint issue Rename 'allowed' to 'associated' Use named functions Add label for why the validation data is being shown Remove wrapping of site-scan-results__source-detail Bump lint-staged from 12.3.4 to 12.3.5 Update perimssions for gutenberg-packages-update workflow Add approve step for auto-merge workflow Add notice step Move conditional from matrix job to its steps Only run PHP feature tests when php files have changed Only run phpunit tests if a PHP file has changed ...
…xel (#6965) Co-authored-by: Piotr Delawski <[email protected]>
Summary
Fixes #6059
This PR changes the way the
AMP_Img_Sanitizer
works.Whenever a Facebook tracking pixel is encountered, e.g.:
it is is replaced with a more suitable
amp-pixel
instead of genericamp-img
.Checklist