2
0

add_tracking_scripts.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. Add Tracking Scripts
  2. ====================
  3. Tracking scripts, such as like Google Analytics or Facebook Pixels, can be added
  4. to the ``<head>`` and ``<body>`` of all of your web pages.
  5. Tracking settings are located in the Wagtail Admin dashboard under
  6. **Settings > Tracking**.
  7. Google Analytics
  8. ----------------
  9. For Google Analytics, all you need is the **GA Tracking ID**. Copy and paste this ID into the field.
  10. Then, if you want to track button clicks, just click the checkbox. Save and you're done!
  11. Other Scripts
  12. -------------
  13. If you have other tracking codes to add, follow these steps:
  14. #. In the Wagtail admin, go to **Settings > Tracking**.
  15. #. The tracking scripts will usually give you instructions of where to place
  16. them. So, make sure to verify the instructions that were given to you.
  17. #. Copy and paste scripts that should be between the ``<head>`` tags in the box
  18. labeled for ``<head>`` scripts.
  19. #. Copy and paste scripts that should be toward the closing ``<body>`` tag in
  20. the box labeled for ``<body>`` scripts.
  21. #. Click **Save** and you're done!
  22. .. figure:: img/head-body-scripts-widgets.png
  23. :alt: The TRACKING dashboard.
  24. The tracking dashboard.
  25. .. note::
  26. You can verify that the scripts on the web page by going to the site and inspecting the Source Code.
  27. Then search for the ``<script>`` tags, either visually or by hitting ``CTRL + F`` on your keyboard
  28. and searching for the code.
  29. Here's how to get the Source Code if you are not sure:
  30. * Firefox: https://developer.mozilla.org/en-US/docs/Tools/View_source
  31. * Chrome: https://support.google.com/surveys/answer/6172725?hl=en
  32. * IE/Edge: https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/resources/