Skip to content

Commit b40427d

Browse files
carljparkersvekars
andauthored
Add gtag() helper function used by star-rating (#2701)
* Add `gtag()` helper function used by star-rating Originally proposed this change in the `pytorch/pytorch_sphinx_theme` repo as PR#188, but SveKars suggested we try it out in `pytorch/tutorials` which does not have as large a scope. * Update _templates/layout.html * Update _templates/layout.html --------- Co-authored-by: Svetlana Karslioglu <svekars@meta.com>
1 parent 17e81c1 commit b40427d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

_templates/layout.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
{{ super() }}
1818
<script>
1919

20-
20+
// Helper function to make it easier to call dataLayer.push()
21+
function gtag(){window.dataLayer.push(arguments);}
22+
2123
//add microsoft link
2224

2325
if(window.location.href.indexOf("/beginner/basics/")!= -1)

0 commit comments

Comments
 (0)