-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add Google Analytics Autolink Helper #1125
Conversation
…integrations working as expected
… + update Jest to pull in for testing
…ers + rename autolink test configs to have a `.data.js` file extension used to exclude from Jest
…est failing mysteriously" This reverts commit 30cb128.
This reverts commit ea83ca0.
…I updates." This reverts commit 32186a8.
…he new page to finish loading before continuing to run checks. https://checklyhq.com/docs/browser-checks/timeouts/#page-waitfornavigation
…ata needed is available
…ally retry if a test fails due to a 502 error from now.sh
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.
Looking good! Some notes:
- This Nightwatch test appears to be failing: Pattern Lab: Confirm SSR Working
- I pulled in latest from master and resolved one conflict, FYI.
- Made a couple inline comments for typos.
And to your questions:
- I like it here in
/packages
since it isn't a traditional component. - Sounds like we need a separate category of component (tools, helpers, etc). Maybe our future docs can include more (or all) of these other packages, but in a separate bucket.
- So
<bolt-autolink>
would wrap a<bolt-link>
? I could see that being useful. But I think the global JS config would be the primary way this gets used. So, let's keep that whatever we do. And I wouldn't necessarily prioritize the custom-element version just to surface docs. Something for the backlog?
Anyway, nice job! I'm approving. Should be good to merge once the build is passing and those typos fixed.
@@ -0,0 +1,93 @@ | |||
# Bolt Autolink | |||
|
|||
Helper library to automatically applies GA [autolink](https://developers.google.com/analytics/devguides/collection/analyticsjs/linker) click tracking query strings to Bolt components that point to external domains. |
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.
typo: "to automatically apply"
</script> | ||
``` | ||
|
||
Option 2. This can also be configured via a Drupal config. For example: |
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.
Nice, great docs! Especially like the Drupal example.
@@ -0,0 +1,3 @@ | |||
$schema: 'http://json-schema.org/draft-04/schema#' | |||
title: 'Bolt Autolink' | |||
description: 'Automatically applies GA autolink click tracking to other Bolt components that containin URLs to external domains' |
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.
typo: "components that contain"
@@ -0,0 +1,107 @@ | |||
import URLSearchParams from '@ungap/url-search-params'; // URLSearchParams poly for older browsers |
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.
I haven't seen this type of interaction between web component events and external scripts yet. Let's review in dev huddle.
…vs a full docker-based deployment based on the branch
…; adjust now.sh deploy commands to use the correct config based on the v1 vs v2 now.sh API
…ng the now.sh deploy process for feature-specific branches
Jira
http://vjira2:8080/browse/WWWD-2988
Summary
Adds a new Google analytics
autolink
helper package to make it easy to wire up Bolt components with Google Analytics Linker plugin so components with external domain URLs (regardless on how a component renders, what browser a component is rendering in, and whether or not a component renders / re-renders) are much easier to track.Details
rendered
custom event every Bolt component emits when initially rendering + re-rendering when data changes), this PR:How to test
Three things in particular @danielamorse I'd like to get your opinion on...
Where exactly in the monorepo codebase do you think this package makes the most sense to live in? I settled on putting this in a new
packages/analytics/autolink
folder with the idea that additional analytics-specific packages will be added, however I also considered having this live in the components folder (despite this package only applying component behavior vs being a "traditional" component).Given that this isn't a "traditional" component, this also unfortunately means it doesn't have docs that automatically show up in the docs / Pattern Lab which I find to be problematic.
Thoughts on this being packaged up as a super simple custom element? ex.
<bolt-autolink>
? That could solve the need to have a proper home for this in addition providing a declarative way to configure the domains being tracked (ex. allow domains to declaratively get passed along via the custom element vs only providing a global JS config option which imho, really doesn't feel like it scales...)