sphinx-contrib / googleanalytics

BSD 3-Clause "New" or "Revised" License
19 stars 13 forks source link

it doesn't work?? #9

Closed germa89 closed 1 year ago

germa89 commented 1 year ago

I am trying to use this extension in one of the project I work on.

The implementation is in here: https://github.com/pyansys/pymapdl/blob/4b66721e5778b978104820b802461f046d99cd47/doc/source/conf.py#L163-L164

The website with the tags is here: https://mapdl.docs.pyansys.com/dev/

I checked and the tag is correctly injected in the different pages: image

jelmer commented 1 year ago

What about it doesn't work? I see a request to google-analytics.com when visiting that page.

germa89 commented 1 year ago

How do you see the request?? Or you mean the code I share the screenshot?

germa89 commented 1 year ago

image

germa89 commented 1 year ago

PR where I merged:

https://github.com/pyansys/pymapdl/pull/1740

jelmer commented 1 year ago

Watching HTTP requests with my browser.

How does the code generated differ from the code suggested by analytics itself?

germa89 commented 1 year ago

I think it is the same.

Analytics suggestion:

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-JQJKPV6ZVB"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-JQJKPV6ZVB');
</script>

Implemented

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/">

    <!-- Google tag (gtag.js) -->
    <script async="" src="https://www.googletagmanager.com/gtag/js?id=G-JQJKPV6ZVB"></script>
    <script>
        window.dataLayer = window.dataLayer || [];
        function gtag(){dataLayer.push(arguments);}
        gtag('js', new Date());
        gtag('config', 'G-JQJKPV6ZVB');
    </script>

    <title>PyMAPDL documentation 0.64.dev0 — PyMAPDL</title>

<script>
  document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
  document.documentElement.dataset.theme = localStorage.getItem("theme") || "light"
</script>
jelmer commented 1 year ago

Those look the same to me. Does it work with the analytics suggestion?

germa89 commented 1 year ago

I just received some data.. it seems it just took a long time.... Thank you!