Skip to content

🐛 Don't append linker for exact domain match, even if in domains.#32100

Merged
micajuine-ho merged 11 commits intoampproject:masterfrom
adamsilverstein:fix/never-autolink-same-domain
Feb 22, 2021
Merged

🐛 Don't append linker for exact domain match, even if in domains.#32100
micajuine-ho merged 11 commits intoampproject:masterfrom
adamsilverstein:fix/never-autolink-same-domain

Conversation

@adamsilverstein
Copy link
Copy Markdown
Contributor

Fixes #30176

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jan 21, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@micajuine-ho micajuine-ho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @adamsilverstein, thanks for your contribution. Can we add a test for this use case in extensions/amp-analytics/0.1/test/test-linker-manager.js?

Additionally, can we add some documentation in extensions/amp-analytics/linker-id-forwarding.md, under destinationDomains describing how we won't link if it's an exact match?

@adamsilverstein
Copy link
Copy Markdown
Contributor Author

@micajuine-ho yes, I will work on those items.

Based on the discussion in the issue, are we going with adding a noInternalLinking option to enable this behavior?

@micajuine-ho
Copy link
Copy Markdown
Contributor

Based on the discussion in the issue, are we going with adding a noInternalLinking option to enable this behavior?

No, right now the only valid use-case seems to be debugging locally. So if there is another use-case, we can consider adding it in.

@adamsilverstein
Copy link
Copy Markdown
Contributor Author

@micajuine-ho I took a pass at a test and docs. Can you please review and revise or advise how to improve?

Also, can you tell me the command to run the test file I added the test to? I'm struggling to figure it out!

@micajuine-ho
Copy link
Copy Markdown
Contributor

Changes LGTM. I've also verified with the ads team that we do not expect Linker to be used in ad environments.

Also, can you tell me the command to run the test file I added the test to?

gulp unit --local_changes

Also, before you submit, run:

gulp lint --local_changes --fix

and address any issues that command brings up. You also might want to rebase again, since I know we've been making a lot of infra changes and it doesn't hurt to keep your this branch up to date.

@adamsilverstein
Copy link
Copy Markdown
Contributor Author

Thanks for the help @micajuine-ho - I have updated the PR:

  • Merged master to branch, resolving conflicts.
  • Ensured linting and new tests pass, switch to using windowInterface mocking like other tests.
  • Added a missing return type to isDomainMatch_ (see Add missing @return types across AMP code #23582)
  • Clarify documentation and correct a couple of typos I noticed in extensions/amp-analytics/linker-id-forwarding.md

@micajuine-ho micajuine-ho merged commit aee80a6 into ampproject:master Feb 22, 2021
@kristoferbaxter
Copy link
Copy Markdown
Contributor

This is great news! @micajuine-ho with this work we can now enable a quicklink like implementation without a Service Worker.

Can you add this to the list for the @ampproject/wg-components group?

@micajuine-ho
Copy link
Copy Markdown
Contributor

Yup adding it to our sprint planning!

@westonruter
Copy link
Copy Markdown
Member

This is great news! @micajuine-ho with this work we can now enable a quicklink like implementation without a Service Worker.

So does this mean #19905 will be brought back?

@kristoferbaxter
Copy link
Copy Markdown
Contributor

@westonruter

We should consider the design from scratch, perhaps we can partner on an implementation soon?

@claudiucelfilip
Copy link
Copy Markdown

Based on the discussion in the issue, are we going with adding a noInternalLinking option to enable this behavior?

No, right now the only valid use-case seems to be debugging locally. So if there is another use-case, we can consider adding it in.

@micajuine-ho In the case of WordPress.com, we relied on internal linking to transition from our AMP Landing Pages to Calypso; which happen to share the same domain.
We've discovered that these changes have been affecting our AMP analytics, which has been addressed.
Going forward, having more control over the linker would be appreciated, and having a noInternalLinking option (or similar) sounds like a good compromise.

@micajuine-ho
Copy link
Copy Markdown
Contributor

We can certainly discuss adding more features into the Linker :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analytics: gtag domain linker adds _gl query parameter even when navigating AMP internal links on origin

7 participants