I wrote a simple PHP analytics script (only 77 lines of code including commenting). It does the following:
a) Gathers the URL, timestamp, IP address, and browser of a visitor.
b) Extracts a unique customer identifier from the URL.
c) Inserts the data into a MySQL database.
The script works fine as a standalone script, but I want to be able to embed it into Wordpress pages on a few different websites (that can all access the same MySQL database).
I don't care how this problem is solved. I only care that it is fast, simple, and secure so it doesn't make the sites vulnerable to attack.
You could:
1) Make it work in PHP as a server side script, modifying it to work with Wordpress.
Or
2) Port it to Javascript to make it work as a client side script, possibly?
I'm not a professional coder. You tell me the best way to do this.