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

Fix wonky html for Google Analytics #640

Merged
merged 3 commits into from
May 24, 2023
Merged

Conversation

KatherineCox
Copy link
Contributor

@KatherineCox KatherineCox commented May 22, 2023

OTTR_Template

I was working on adding Google Analytics to some AnVIL books and noticed a couple of things that could use improvement. This PR:

  • removes unneeded html from GA_script (was adding extra head and body tags to the page)
  • renames GA_script.Rhtml -> GA_script.html (there's no R code in this?)

I've tested this in https://github.com/jhudsl/GDSCN_Book_swirl and I'm seeing activity being recorded in Google Analytics dashboard, so it seems to be working correctly.

Wiki

The wiki (https://github.com/jhudsl/OTTR_Template/wiki/Google-Analytics) will also need updating with instructions to include the script in _output.yml (using in_header rather than before_body). I added a new screenshot in this PR, but haven't updated the wiki since this isn't merged yet.

Here's a suggestion for new text for step 7:

7) Add a line to the _output.yml file above the line that starts with `before body:` (i.e. nested under `includes`).  This line should be `in_header: GA_Script.html`.  Make sure this line is indented to the same level as the `before body:` line.

![](https://raw.githubusercontent.com/jhudsl/OTTR_Template/main/resources/screenshots/output_file_with_GA.png)

@github-actions
Copy link
Contributor

github-actions bot commented May 22, 2023

Re-rendered previews from the latest commit:

Updated at 2023-05-22 with changes from bc34d2c

@github-actions
Copy link
Contributor

github-actions bot commented May 22, 2023

No broken urls! 🎉
Comment updated at 2023-05-22 with changes from bc34d2c

@github-actions
Copy link
Contributor

github-actions bot commented May 22, 2023

No spelling errors! 🎉
Comment updated at 2023-05-22 with changes from bc34d2c

@KatherineCox KatherineCox requested a review from cansavvy May 22, 2023 20:13
@cansavvy
Copy link
Collaborator

@KatherineCox Thanks so much for these fixes! I think all looks good!

The wiki (https://github.com/jhudsl/OTTR_Template/wiki/Google-Analytics) will also need updating with instructions to include the script in _output.yml (using in_header rather than before_body). I added a new screenshot in this PR, but haven't updated the wiki since this isn't merged yet.

As far as documentation updating, we will want to add and update this on the ottrproject.org website. Probably as a new header in this file: https://github.com/jhudsl/ottr-website/blob/main/more_features.Rmd

Would you be willing/able to file a PR to that repo to make that change? Unfortunately we still hadn't ported over all the wiki changes to the website (this is long been overdue).

@KatherineCox
Copy link
Contributor Author

Would you be willing/able to file a PR to that repo to make that change? Unfortunately we still hadn't ported over all the wiki changes to the website (this is long been overdue).

@cansavvy Sure, I can do that!

@KatherineCox KatherineCox merged commit 7598d49 into main May 24, 2023
@KatherineCox KatherineCox deleted the KCox-improve-google-analytics branch May 24, 2023 19:29
@cansavvy
Copy link
Collaborator

@cansavvy Sure, I can do that!

Yay! Thanks so much!

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.

2 participants