Uploaded image for project: 'VIVO'
  1. VIVO
  2. VIVO-1673

Move googleAnalytics.ftl include into headScripts.ftl

    Details

    • Type: Task
    • Status: Received (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: v1.10
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Attachments:
      0
    • Comments:
      0

      Description

      Google Analytics documentation suggests putting the analytics code in the head of the page, rather than at the very end. 

      This change is due to the script now loading asynchronously. My understanding is that if you keep it at the end, the script will not load until the entire page has loaded. For large VIVO pages may be a long time, which will mess up the analytics.

      For reference, here's the current include path... page.ftl > scripts.ftl > googleAnalytics.ftl

      https://github.com/vivo-project/VIVO/blob/develop/webapp/src/main/webapp/themes/wilma/templates/googleAnalytics.ftl

      https://github.com/vivo-project/Vitro/blob/1570f529571b924029b401fd918f43144e35afdf/webapp/src/main/webapp/templates/freemarker/page/partials/scripts.ftl

      https://github.com/vivo-project/Vitro/blob/d2c34ddf46cb781a788f71736e67ffd649b56d00/webapp/src/main/webapp/templates/freemarker/page/page.ftl 

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mbgross Benjamin Gross
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: