'How to write a javascript tracking code?

I want to write a simple javascript tracking code that should be able to push parameters to a remote server.

  • What should I pay attention when writing this code?
  • Is there a difference with the new asynchronous codes around (google analytics style)?
  • Can you provide a very basic example code?

Thank you



Solution 1:[1]

I would suggest to use jQuery ajax features. Comes with good documentation and examples.

You can send stuff synchronously or asynchronously, via GET, POST etc. See the linked documentation.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Blasius Secundus