Skip to content
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

Initial Amplitude Implementation, second try #49442

Merged
merged 17 commits into from
Dec 14, 2022

Conversation

rshipp
Copy link
Contributor

@rshipp rshipp commented Dec 12, 2022

Followup to #49374/#49440 , with modified config.

Links

Testing story

Must be tested after deployment, unfortunately.

Deployment strategy

Secrets already added to AWS.

@rshipp rshipp requested a review from a team December 12, 2022 21:35
@rshipp rshipp marked this pull request as ready for review December 12, 2022 21:37
Copy link
Contributor

@hannahbergam hannahbergam left a comment

Choose a reason for hiding this comment

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

tbh, I'm not sure I fully understand how the keys work, but the last commit you made makes sense to me

@@ -13,3 +13,6 @@ custom_error_response: false

# Configurations for making calls to the Immersive Reader API on Azure
imm_reader_client_id: '74937af0-55ee-411a-867a-57eefadec7d9'

# General CDO Amplitude key
cdo_amplitude_api_key: !Secret
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is fine but I'm confused still why staging broke before. It's definitely possible y'all understand and I'm still playing catchup so if that's the case, feel free to merge :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I definitely don't understand why it broke, so if you have any other ideas we should try those too!

@@ -23,6 +23,8 @@
-# data needed for dcdo.js. This tag is needed on every page because our translation code is
-# making use of the dcdo feature.
%script{data: {'dcdo': DCDO.frontend_config.to_json}}
-# auth key needed for amplitude analytics.
%script{data: {'amplitude-api-key': CDO.safe_amplitude_api_key}}
Copy link
Contributor

Choose a reason for hiding this comment

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

It's worth noting that if the key can't be found, <script data-amplitude-api-key=""></script> will be on the page but if the key is nil this element won't be on the page at all. This seems fine though because we can handle the element not existing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the JS handles both cases in basically the same way, but I do prefer the empty string one because it makes it easier to look for the script tag in the page during development. That tripped me up a few times looking for an attribute that didn't exist.

@rshipp rshipp merged commit 8b6fbcf into staging Dec 14, 2022
@rshipp rshipp deleted the bethany-and-ryan/amplitude-secrets branch December 14, 2022 15:24
bethanyaconnor added a commit that referenced this pull request Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants