pytorch_sphinx_theme
pytorch_sphinx_theme copied to clipboard
Restore the gtag JavaScript function to re-enable metrics
The associated issue is in the pytorch/tutorials repository:
Issue #2696 · [BUG] No longer collecting star-rating data...since transition to GA4 https://github.com/pytorch/tutorials/issues/2696
The gtag function is used by metrics such as star-rating in the tutorials repository (which leverages pytorch_sphinx_theme).
The definition for the gtag function was deleted in the transition to Google Analytics 4 (GA4) in PR#182, which in-turn broke our metrics.
This commit restores the definition of the function to re-enable these metrics.