Last update at :2024-04-08,Edit by888u
Please note:
This tutorial only applies to the installation of ordinary JS statistics code or advertising code. If you need to place Baidu asynchronous loading statistics code and other similar codes, please directly remove the head and tail of the asynchronous statistics code, that is, remove "", and then place it at the bottom of the JS file.
Now start placing the normal statistics code or advertising code:
There are many ways to add advertising and statistics codes to web pages. Directly referencing JS files and JS methods are common adding methods. So how can we add them correctly?
Here is how to convert advertising code or statistical code. What is mentioned here is only one of the methods. There are many other methods that can be used.
1. Delete all line breaks in the advertising code or statistical code, so that the final advertising code (statistical code) becomes only one line.
2. Add a backslash (i.e. /) before all double quotes (i.e. ”) in the advertising code or statistics code.
In this way, the advertising code or statistics code can be converted into a JS file for use.
Note:
1. The general advertising code is already in the form of JS. There is no need to "html to js" conversion code. You can directly use the obtained advertising code to modify it using the above method.
2. Only modify the statistics code or advertising code. The original existing code does not need to be modified.
3. JS has very high format requirements. Please strictly follow the two points mentioned above, otherwise the entire JS file may cause errors.
The following are examples of statistical code and advertising code. If you understand the above, please skip it:
The statistical code just obtained is as follows: (CNZZ)
As you can see from this example, you need to delete the line break first, and then add / before " . Some people will ask here. There is a line break above, but in fact it is not a line break. It is just that one line cannot be displayed. Automatic line wrapping is different from what we call manual line wrapping. To determine whether it is a real line wrapping, you can put the code in Notepad, and then uncheck the Format -> Automatic line wrapping in Notepad to see the code. Is there a line change?
Recommended site search: IP server, Zhengzhou virtual host, Korean cn2 server, Hong Kong proxy server, cloud host, free server, me domain name, icp filing query network, asp free space application, filing, code>
Then the modified code is as follows:
The modified code is as follows:
发表评论