Coder Social home page Coder Social logo

Comments (3)

jhilden avatar jhilden commented on May 22, 2024

As a rule of thumb: yes tracking JS code should be appended to the <body>, but there are certain "business-criticial" tracking codes that you might want to include the <head> instead to make sure they fire, even if the page was left very quickly by the user or some other javascript was unable to load. For example the Google Analytics tracking code (which by the way also loads asynchronously, so page loading is not blocked even though it's included in the <head>). Also the ga tracking code has some features like page load tracking, real-time reporting that only work if you put the code in the ยดยด

from rack-tracker.

salimhb avatar salimhb commented on May 22, 2024

you can set the position to your liking, like this: https://github.com/railslove/rack-tracker/blob/master/spec/integration/google_analytics_integration_spec.rb#L22

from rack-tracker.

DonSchado avatar DonSchado commented on May 22, 2024

could catch. yes each handler has a position setting.
but we sadly missed to document the feature @salimhb mentioned :)

from rack-tracker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.