How to implement Google Analytics and save daily statistics of a webpage in a database [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I would like to know how to implement Google analytics and make an SQL query from PHP to save daily webpage statistics.
Thank you for your answers.

There are a lot of issues that you will need to overcome to get this to work. It's not as simple as just adding a file to your site. You will first need to set up analytics on your site using the javascript that Google provides.
Next you will need to connect to the Google servers either using a PHP API like GAPI, curl or OAuth. You could also try a JSON solution. I personally like using the OAuth method for the ease of use. There are OAuth libraries that can do the heavy lifting, too.
After you have the data you need, you need to add it to the database. You can do this within the PHP for the request, or with AJAX. Both methods are decent. The SQL itself is up to you. If you are using some sort of CMS, try using their database methods instead of writing your own. If you are writing one from scratch, I would suggest the PDO API in PHP. It takes care of a lot of the security vulnerabilities you usually have with SQL and it's well documented.
All-in-all, there are a lot of moving parts to this process. I would suggest looking for someone who has all, or most, of the leg work already done before diving into it yourself.

Related

How do I make a web app with Google APIs? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 10 months ago.
Improve this question
I am pretty new to web dev, and I wanted to create a simple UI in Javascript with the Google Maps Places API to familiarize myself with everything. My question is, would I just make direct URL requests with the user’s variables, or would I have to create something server side, and if so, what would I have to do?
It depends on your application's functionality. Generally, you could keep all everything on the client-side. If you app is a server-rendered one, meaning you would be using a JavaScript framework like React or Vue, you could use just the website state to keep track of users' variables and send out requests to the Google APIs to do the heavy work.
You could also look into tools like Firebase, also created by the folks at Google to handle storage or user authentication. There are rich docs on how to include Firebase in your web application for your framework of choice. This way you can create language-agnostic backend resources that conform to all of the security measures and scales automatically so you can focus on the users' experience.
In case you would like to offer some less-common functionality or have complete control over the backend you could write up an API of your own and have it deployed on a separate backend server.

How to make a working login functions for my website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed last year.
Improve this question
I am just entered this game since last December. Now I finished HTML CSS and a little bit of Java Script yet I got stuck at this stage: I can do basic styling but I don't know how to make it interactive.
So my question is :
how can I make a login function for websites, which can gives visitor an account (sign up, login, forgot password) that can do basic things like comment , add to basket and favorite a product?
Don't need to be specific, please just highlight which language is involved in which stage.
Thanks ahead.
Now I finished HTML CSS and a little bit of Java Script
So your site is what is called a static website.
If you want to allow login and data storing, you need a dynamic website, that requires one of this technologies:
PHP
ASP (check also ASP.NET)
Node.js (with express or http module)
Django (Python's library)
A few others...
All this technologies are called server-side languages/technologies, and the most used for long years has been PHP, that now has some strong rivals in terms of usage.
You can use only html/js to create a website. But, if you need authentication, post comments, a server side is needed.
A js can call easely an API to authenticate (server side) and post comments with XHR. You have to create it. You need to know how Authentication headers works for server side. You need to have a database (sql, file or nosql, it's your choice) to save the users datas and rights.

Completely replace MySQL (or any SQL) DB with Google Sheets [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Let's say HYPOTHETICALLY that...
I am building a webtool that pushes data onto a user-selected MySQL table in a user-selected MySQL database using user-selected MySQL username [bogus_username] with user-selected MySQL password [bogus_password].
I would like to extend this hypothetical tool's capability to where it can push data onto any sort of database.
Technically, a Google Sheet is a "database."
So, how do I hypothetically build a script that logs onto a user's google drive and opens a google sheet up for data manipulation?
I am looking for a solution that either uses client-side JS, nodeJS, or PHP. Either language will do. I am just trying to understand how to do this CONCEPTUALLY, so what language you build the script in doesn't matter, as long as I can understand it.
all these "hypothetical"s mean I KNOW I DON'T HAVE CODE! I am not looking for code, but for code concept
Google sheets has a an api. There are many modules which use this api or provide wrappers for this api. Since you mention NodeJS you could hust do an npm search.
Somewhere in your code you will have a storeRecord function which could, depending on your configuration, store the data to mysql or google sheets, or whatever. You will need to implement some different code for database systems that do not use the same protocol. If the protocol is the same (e.g. ODBC is used by many databases) then you will just require different configuration settings.

Want to create a new application for website traffic monitoring ( analysis ) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to create my own application for monitoring traffic of my website without using any third party tools like google analytics. In which I want to log screenshots, user details, page details and cookies. So what technology should I opt so as to achieve this goal and which will be best suited and what work flow should I follow.
I've never done this kind of work previously so I'm new to this. Any help would be greatly appreciated.
The technologies I know are : javascript, nodejs, django(python).
You will have to break down your application as it is a humongous task to create something like GA.
You will have to track many user activities(click,spend time etc).so you can do that in plain js or use a cross-platform lightweight library(angular.js) that can make your life a little easy.
Now since you will have to send large set of traced data to you database with minimum latency,use Node.js in this scenario.Simple Ajax call would also work but then it would be very slow.
Now comes your database.Prefer NoSql since it suits your requirement of unstructured data ,preferrablly MongoDb which can help you with its own mapReduce,large storage capacity
.Since there will be lot of calculation involved you can use your python knowledge which can help you process data a lot faster.you can use other languages as well(eg.Go)
Your processed data and results can then be stored in Redis(which acts as a caching layer).
you can use sophisticated graphic library like d3.js,Highcharts.js for displaying Graphical data on the client-side.
There are a lot of factors that can be involved.This is just a very basic outline of what you could do.

how would I build a comments box? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm interested in creating my own comments box for my website. I want it to be very similar to facebook's commenting system. How difficult would this be and what language is the best for something like this? Also, could someone point me towards some documentation that would help me learn how to do something like this?
Using Rails for the back-end, but could build the box with php preferably using heroku or mysql databases.
If you want to create comments box like Facebook, then you will have to use some server sided scripting technology like PHP, Servlets or any other which does the same thing as these do.
And you will also have to learn DATABASES like mysql, Oracle, Microsoft SQL, etc.
Since these will be used to store comments and retrieve Comments.
My suggestion will be use PHP And MySQL because they are free to use and you can learn these from W3Schools.com.

Categories