CN111277615B - User behavior tracking method based on browser, terminal device and server - Google Patents

User behavior tracking method based on browser, terminal device and server Download PDF

Info

Publication number
CN111277615B
CN111277615B CN201811474257.5A CN201811474257A CN111277615B CN 111277615 B CN111277615 B CN 111277615B CN 201811474257 A CN201811474257 A CN 201811474257A CN 111277615 B CN111277615 B CN 111277615B
Authority
CN
China
Prior art keywords
session
browser
page
party domain
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811474257.5A
Other languages
Chinese (zh)
Other versions
CN111277615A (en
Inventor
曹柯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811474257.5A priority Critical patent/CN111277615B/en
Publication of CN111277615A publication Critical patent/CN111277615A/en
Application granted granted Critical
Publication of CN111277615B publication Critical patent/CN111277615B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/535Tracking the activity of the user
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications

Abstract

The invention discloses a user behavior tracking method based on a browser, terminal equipment and a server. The method comprises the following steps: acquiring a site page, wherein a first script is embedded in the site page in advance; when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance; when the second script is executed, the session identification of the session is acquired from the local storage of the browser, and the session identification of the session is provided for the first script; and when the first script is executed, marking the log of the site page by using the session identifier of the session, and sending the marked log to a log server.

Description

User behavior tracking method based on browser, terminal device and server
Technical Field
The invention relates to the technical field of internet, in particular to a user behavior tracking method based on a browser, a terminal device and a server.
Background
In internet products, it is necessary to track behavior data of users when using products for the purpose of improving user experience and the like.
In browser-type products, a special acquisition server generally provides a Cookie (data stored on a local terminal of a user) for tracking to a browser accessing a site server, so as to realize user behavior tracking. The reason for this is that HTTP (HyperText Transfer Protocol) used in the world wide web is a stateless Protocol, and needs to determine the identity of a user and maintain the session state by means of cookies.
However, since the total amount of cookies that can be saved by the browser has an upper limit, when too many cookies are tracked, the important cookies may be lost. Moreover, since generating the tracking Cookie depends on the access of the browser to the collection server, when the user is distributed in each region, a sufficient number of collection servers need to be deployed, which makes the hardware cost of the existing scheme higher.
Disclosure of Invention
The embodiment of the application provides a user behavior tracking scheme based on a browser, and no tracking Cookie is required to be introduced into the scheme, so that the technical defect caused by introduction of the tracking Cookie is avoided.
The embodiment of the application discloses the following technical scheme:
a user behavior tracking method based on a browser comprises the following steps:
acquiring a site page, wherein a first script is embedded in the site page in advance;
when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance;
when the second script is executed, the session identification of the session is acquired from the local storage of the browser, and the session identification of the session is provided for the first script; and the number of the first and second groups,
when the first script is executed, the conversation mark of the conversation is used for marking the log of the website page, and the marked log is sent to the log server.
Preferably or optionally, the obtaining a session identifier of the session from a local storage of the browser includes:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, the obtaining of the session identifier of the current session from the third-party domain name storage area of the session storage area of the current session of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, creating a session identifier of the session, including:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
Preferably or optionally, the third-party domain page is a page deployed in the CDN network;
obtaining a third-party domain page, comprising: and acquiring a third-party domain page from a node server of the CDN.
Preferably or optionally, obtaining a third party domain page comprises:
and creating an iframe element to control the browser to acquire a third-party domain page and nest the third-party domain page into the site page.
A user behavior tracking method based on a browser comprises the following steps:
a first script is embedded into a website page in advance, and the website page is issued to a browser; wherein the content of the first and second substances,
when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance;
when the second script is executed, the session identification of the session is acquired from the local storage of the browser, and the session identification of the session is provided for the first script; and the number of the first and second groups,
when the first script is executed, the conversation mark of the conversation is used for marking the log of the website page, and the marked log is sent to the log server.
Preferably or optionally, the obtaining a session identifier of the session from a local storage of the browser includes:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, the obtaining of the session identifier of the current session from the third-party domain name storage area of the session storage area of the current session of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, creating a session identifier of the session, including:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
Preferably or optionally, the third-party domain page is a page deployed in the CDN network;
obtaining a third-party domain page, comprising: and acquiring a third-party domain page from a node server of the CDN.
Preferably or optionally, obtaining a third party domain page comprises:
and creating an iframe element to control the browser to acquire a third-party domain page and nest the third-party domain page into the site page.
A terminal device, comprising:
a memory for storing executable instructions;
a processor for performing the first method of the foregoing embodiments under the control of executable instructions.
A server, comprising:
a memory for storing executable instructions;
a processor for performing the second method as in the previous embodiments under the control of the executable instructions.
According to the user behavior tracking method based on the browser, the terminal device and the server, the user behavior data are marked through the session identification in the local storage space, and the tracking Cookie is not required to be introduced, so that the problems that other important Cookies stored in the browser are lost due to the fact that the Cookie is tracked and the like are solved. In addition, in this embodiment, the session identifier is obtained in the terminal device where the browser is located, and a large number of acquisition servers for providing the tracking cookies do not need to be deployed, so that the hardware deployment cost in this embodiment is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 illustrates a block diagram of a user behavior tracking system that may be used to implement an embodiment of the present invention.
Fig. 2 shows a flowchart of a user behavior tracking method that can be used to implement embodiment one of the present invention.
Fig. 3 shows a flowchart of a user behavior tracking method that can be used to implement the second embodiment of the present invention.
Fig. 4 shows a flowchart of a user behavior tracking method that can be used to implement a third embodiment of the present invention.
Fig. 5 shows a block diagram of a terminal device that may be used to implement an embodiment of the invention.
FIG. 6 illustrates a block diagram of a server, which may be used to implement an embodiment of the invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< user behavior tracking System >
As shown in fig. 1, the user behavior tracking system 1000 provided in this embodiment includes a server 1100, a terminal device 1200, and a Network 1300, where the server 1100 includes one or more site servers 1100-1, one or more CDN (Content Delivery Network) node servers 1100-2, and one or more log servers 1100-3.
The server 1100 may be, for example, a blade server, a computer, or the like. The server 1100 may also include, as shown in FIG. 1, a processor 1110, a memory 1120, an interface device 1130, a communication device 1140, a display device 1150, and an input device 1160. Although the server 1100 may also include a speaker, a microphone, and the like, these components are not relevant to the present invention and are omitted here. The processor 1110 may be, for example, a central processing unit CPU, a microprocessor MCU, or the like. The memory 1120 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1130 includes, for example, a USB interface, a serial interface, and the like. The communication device 1140 is capable of wired or wireless communication, for example. The display device 1150 is, for example, a liquid crystal display panel. Input devices 1160 may include, for example, a touch screen, a keyboard, and the like.
Server 1100 includes site server 1100-1, CDN node server 1100-2 and log server 1100-3. Where CDN node server 1100-2 is a node server belonging to a CDN network. The CDN network is a distributed network established and overlaid on a bearer network and composed of edge node server clusters distributed in different areas, and can replace a conventional web server-centric data transmission mode. Under a certain rule, the CDN node server 1100-2 is responsible for processing the request sent by the terminal device 1200 to the CDN network. In one example, CDN node server 1100-2 is a node in the CDN network that is relatively close to end device 1200.
The terminal device 1200 may be a smartphone, a laptop, a desktop computer, a tablet computer, or the like. As shown in fig. 1, the terminal apparatus 1200 may include a processor 1210, a memory 1220, an interface device 1230, a communication device 1240, a display device 1250, an input device 1260, a speaker 1270, a microphone 1280, and the like. The processor 1210 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1220 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1230 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1240 can perform wired or wireless communication, for example. The display device 1250 is, for example, a liquid crystal display, a touch display, or the like. The input device 1260 may include, for example, a touch screen, a keyboard, and the like. A user can output/input voice information through the speaker 1270 and the microphone 1280.
The terminal device 1200 has browser-like software installed therein. In this embodiment, the browser-like software refers to software having or embedded with a browser function, for example, the browser-like software may be a mobile phone application embedded with a browser component, the browser-like software may be a browser application installed in a mobile phone, and the browser-like software may be a browser application installed in a computer. The browser to be mentioned below may refer to the browser-like software herein.
The communication network 1300 may be a wireless network or a wired network, and may be a local area network or a wide area network. The terminal device 1200 may communicate with the site server 1100-1, the CDN node server 1100-2, and the log server 1100-3 through the communication network 1300.
The user behavior tracking system 1000 shown in FIG. 1 is merely illustrative and is in no way intended to limit the invention, its application, or uses.
< method for tracking user behavior >
< example one >
The embodiment provides a user behavior tracking method, which is implemented by a terminal device installed with browser software, such as the terminal device 1200 shown in fig. 1.
As shown in fig. 2, the method in this embodiment includes the following steps:
step S101, a browser acquires a site page, and a first script is embedded in the site page in advance.
In this embodiment, the website page refers to a target page that the user intends to access through a browser function of the browser-like software of the terminal device, for example, a home page of a certain shopping website. And the server corresponding to the site page is a site server.
The script in the present embodiment is a command that can be executed. The first script is pre-embedded into the site page by the site server. When the browser requests the site page, the site server returns the site page embedded with the first script to the browser.
Step S102, when the first script is executed, the browser acquires a third-party domain page, and a second script is embedded in the third-party domain page in advance.
The first script may implement a corresponding function through an API (Application Programming Interface) of the browser when being executed.
In this embodiment, the third-party domain page is a preset page for tracking the user behavior. The third-party domain page is different from the site page and is loaded by the browser. When the third-party page is obtained, the site page itself is not greatly affected, for example, the site page is not closed, and the site page is not reloaded.
And the second script is embedded into the third-party domain page in advance by a server corresponding to the third-party domain page.
Step S103, when the second script is executed, the browser obtains the session identifier of the current session from the local storage of the browser and provides the session identifier to the first script.
In this embodiment, a session refers to a process from a user opening a new page through a browser in a non-jumping manner, and successive page accesses are performed through the new page in a jumping manner until all the pages are closed. For example, a user inputs an address of a certain shopping website in a browser, and opens a homepage of the shopping website; clicking a first commodity on a homepage of the shopping website, and jumping to a page of the first commodity; clicking a second commodity on the opened page of the first commodity, and jumping to the page of the second commodity; jumping to the homepage of a certain news website from the homepage of the shopping website; this session includes access to the home page of the shopping website, the page of the first item, the page of the second item, and the home page of the news website, wherein jumping from the home page of the shopping website to the home page of the news website is a cross-domain access.
The session identification is used to mark each session to distinguish between sessions.
In the present embodiment, the session identifier is stored in a local storage of the browser, that is, in a local storage of the terminal device where the browser is located, for example, in the memory 1220 of the terminal device 1200 shown in fig. 1.
And step S104, when the first script is executed, the browser marks the log of the site page by using the session identifier of the session, and sends the marked log to the log server.
The log of the site page may include data describing user behavior, for example, a record of the user's operation in the current site page.
The log of the site page records the user behavior data in the current page. If a user visits pages of multiple same sites or different sites consecutively in a session, multiple logs belonging to the same session are generated. And giving the same and unique session identification to the logs belonging to the same session so as to mark the logs belonging to the same session.
The log server is used for receiving logs of site pages. Each log received by the log server is provided with a session identifier, and the log server can determine which logs belong to the same session through the session identifier, so that complete behavior data of the user in each session can be obtained. User preferences, user experience improvement, and the like may be analyzed using the behavioral data.
In the user behavior tracking method based on the browser, the log is marked through the session identifier in the local storage space, and the tracking Cookie is not required to be introduced, so that other important Cookies stored in the browser due to the tracking Cookie are prevented from being lost. Optionally, since no tracking Cookie is introduced during the interaction between the browser and the site, additional traffic consumption between the browser and the site can be avoided. Optionally, in this embodiment, the session identifier is obtained in the terminal device where the browser is located, and a large number of acquisition servers for providing the tracking Cookie do not need to be deployed, so that the hardware deployment cost of this embodiment is reduced.
Further, in this embodiment, acquiring the session identifier of the session from the local storage of the browser includes:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser. The third-party domain name refers to a domain name of a third-party domain to which the third-party domain page belongs.
According to the mechanism of the browser, when a user starts a session, the browser creates an independent session Storage area (session Storage) for the session, wherein each domain name involved in the session corresponds to an independent sub-Storage area, and the sub-Storage areas are isolated from each other. When the session ends, the session storage area for the session is cleared.
For example, the user starts a session, accesses a page of site a, and a third-party domain page of a third-party domain is opened in the browser by execution of the first script and the second script. An independent session storage area is created for the session in the local storage of the terminal equipment, and the session storage area of the session comprises a site A domain name storage area and a third party domain name storage area. And then, the user opens a page of the site B in the session in a mode of cross-domain jumping from the page of the site A, and the third-party domain page of the third-party domain is opened in the browser again through the execution of the first script and the second script. At this time, the session storage area of the current session still exists, and the session storage area is additionally provided with a site B domain name storage area on the basis of the site A domain name storage area and the third party domain name storage area. When the session is finished, the session storage area of the session, including the site A domain name storage area, the third party domain name storage area and the site B domain name storage area, is cleared.
By the storage mode of the session identification, the corresponding relation between the session identification and the session can be conveniently determined.
In the embodiment, a session storage mechanism of the browser is utilized, and because a third-party domain page is introduced when a site page is acquired every time, the identifier of the session is always stored in the third-party domain name storage area of the session of the browser, even if cross-domain skip or cross-protocol skip occurs in the session, the session identifier is not lost, and the reliability of the scheme is improved.
Further, in this embodiment, the process of obtaining the session identifier of the current session from the third-party domain name storage area of the current session storage area of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
The third party domain page may be opened multiple times in a session. It can be understood that when the third-party domain page is opened for the first time, the session identifier of the session does not exist in the third-party domain name storage area of the session, and at this time, the session identifier of the session is created and stored in the third-party domain name storage area. When the third-party domain page is opened again in the session, the browser can directly acquire the created session identifier of the session from the third-party domain name storage area.
The session identifier of the session is obtained in the mode, and the uniqueness of the session identifier can be ensured.
Further, in this embodiment, the process of creating the session identifier of the session includes:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
In order to avoid the repetition of the session identifier as much as possible, the present embodiment utilizes the browser's own mechanism, and creates the session identifier by using the random number generated by the browser and the current timestamp. Since the accuracy of the browser-generated time stamps can reach a high level (e.g. millisecond accuracy) and in combination with the high randomness of the random numbers, the probability of repetition of the session identification can be reduced to a sufficiently small degree.
Further, in this embodiment, the third-party domain page is a page deployed in the CDN network, that is, the third-party domain is the CDN network. The terminal device 1200 may select a nearby node server from a plurality of CDN node servers of the CDN network to obtain the third-party domain page.
By deploying the third-party domain page in the CDN, the third-party domain page can be loaded more quickly and stably. Especially, in a global background, users are distributed in various regions, and the acceleration effect of the CDN is more obvious.
Further, in this embodiment, the process of acquiring the third-party domain page includes:
and creating an iframe (inline frame) element to control the browser to acquire the third-party domain page and nest the third-party domain page into the site page.
The specific process is as follows: the first script creates an iframe element through a Document Object Model (DOM) Application Programming Interface (API), and when the iframe element is created, according to an address of a third-party domain page preset in the first script, an src (source file) attribute of the iframe element is set, so that the browser is controlled to acquire the third-party domain page according to the address of the third-party domain page, and the third-party domain page is nested into a site page.
The third-party domain page is obtained by creating the iframe element, so that great influence on the site page browsed by the user can be avoided.
It will be appreciated that the third party domain page may also be obtained by means other than creating an iframe element, such as loading the third party domain page in a new window.
< example two >
The embodiment provides a user behavior tracking method, which is implemented by a site server, for example, the site server 1100-1 shown in fig. 1.
As shown in fig. 3, the method in this embodiment includes the following steps:
step S301, a site server embeds a first script in a site page in advance and issues the site page to a browser of a terminal device;
step S302, a browser of the terminal device opens a website page and runs a first script.
Wherein the first script is a script having a special function. Specifically, the first script has the following special functions:
when the browser of the terminal device opens a website page and runs the first script, the following steps S303-S305 are automatically executed:
step S303, when the first script is executed, the browser acquires a third-party domain page, and a second script is embedded in the third-party domain page in advance.
Step S304, when the second script is executed, the browser obtains the session identifier of the current session from the local storage of the browser and provides the session identifier to the first script.
Step S305, when the first script is executed, the browser marks the website page by using the session identifier of the session, and sends the marked log to the log collection server.
The specific implementation of steps S303-S305 can refer to steps S102-104, and the description is not repeated here.
< example three >
The following description further illustrates the user behavior tracking method provided by the present disclosure with a specific embodiment, and the implementation subject involved includes a terminal device installed with browser-like software, a site server, a CDN node server, and a log server. The terminal device may be the terminal device 1200 shown in fig. 1, the site server may be the site server 1100-1 shown in fig. 1, the CDN node server may be the CDN node server 1100-2 shown in fig. 1, and the log server may be the log server 1100-3 shown in fig. 1, and the constituent structures of the related devices are not described herein again.
In one session, a user continuously acquires a site page for multiple times through a browser of a terminal device. In one session, the processing procedure after the browser acquires the site page each time includes the steps as shown in fig. 4:
step S2100, the browser in the terminal device acquires a site page.
Specifically, step S2100 includes the following steps S2101 and S2102:
step S2101, the browser requests a site page from the site server.
In step S2102, the site server returns the site page embedded with the first script to the browser.
After the browser of the terminal device acquires the site page, the following step S2200 is performed:
in step S2200, the first script is executed in the browser.
In this embodiment, the first script, when executed, implements the corresponding function through the API of the browser.
When the first script is executed, the browser performs the following sub-processes:
the first sub-process includes steps S2300-S2323, which is used to obtain a session identifier of the session.
In step S2300, when the first script is executed, the browser obtains a third-party domain page.
This step also includes the following steps S2301 and S2302:
step S2301, the browser requests a third-party domain page from the CDN node server.
Step S2302, the CDN node server returns the third-party domain page embedded with the second script to the browser.
That is to say, the third-party domain page in this embodiment is a page deployed in the CDN network, which is beneficial to fast loading of the third-party page. It should be understood that the third party domain page may also be other types of pages.
After the browser acquires the third-party domain page, the following step S2310 is performed:
in step S2310, the second script is executed in the browser.
The second script may also implement the corresponding functionality through the API of the browser.
When the second script is executed, the browser performs the following step S2320:
step S2320, obtain the session identifier of the session from the local storage of the browser.
In one example, the second script calls a Web Storage API (Web Storage application Programming Interface) to obtain the session identifier of the session from a third-party domain name Storage area of the session.
When the session identifier is acquired, the following step S2321 is performed:
step S2321, whether the session identifier of the current session exists in the third party domain name storage area of the session storage area of the current session is judged.
If a session identity exists, it can be directly sent to the message channel in the subsequent step S2331.
If the session identifier of the session does not exist in the third-party domain name storage area of the session, performing the following step S2322:
step S2322, the browser creates a new session identifier.
After the session identifier is created, the following step S2323 is performed:
step S2323, the created session identifier is stored in the third-party domain name storage area of the session storage area of the current session, and then step S2331 is executed.
By performing steps S2300 to S2323, it can be ensured that the session identifier of the current session exists in the third-party domain name storage area of the session storage area of the current session, so that the browser can obtain the session identifier of the current session, and send the session identifier to the message channel through step S2331.
Further, in step S2322, the process of creating a new session identifier includes the following steps:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
The creation of the session identifier makes use of the browser's own mechanism and avoids duplication of the session identifier as much as possible.
Further, in step S2300, when the first script is executed, the third-party domain page is obtained by the following steps:
and creating an iframe (inline frame) element to control the browser to acquire the third-party domain page and nest the third-party domain page into the site page.
Therefore, the third-party page is obtained, and the large influence on the site page can be avoided.
The second sub-process includes step S2400, when the first script is executed, the browser registers the message channel. Through the message channel, the second script can provide the acquired session identifier of the session to the first script.
The third sub-process includes steps S2500-S2530.
Step S2500, when the first script is executed, the browser loads the monitoring item plug-in.
After the monitoring item plug-in is loaded, the following step S2510 is performed:
step S2510, the browser registers the monitoring item plug-in and sets the type of the event to be monitored.
After the monitoring item plugin registration is completed, the following step S2520 is performed:
step S2520, monitoring the events of the preset types in the website page by the monitoring item plug-in.
After the monitoring item plug-in unit monitors that the event of the preset type occurs, the following steps are performed in step S2530:
and step S2530, the monitoring item plug-in creates a log.
The log records the monitored content, namely the user behavior data.
After the monitoring item plug-in creates the log, step S2540 is executed to push the created log to the log queue.
The fourth sub-process includes steps S2600-S2620.
In step S2600, when the first script is executed, the browser initializes the log queue.
The log queue is used for receiving the logs pushed in the step S2540 in the subsequent process, and maintaining the sequency of the logs.
Step S2610, initializing a log transmitter. In the subsequent process, the log transmitter is used for transmitting the log with the session identifier of the session to the log server.
The order of step S2600 and step S2610 may be switched.
After the session identifier is transmitted to the message channel in step S2331, step S2332 is performed to transmit the session identifier in the message channel to the log transmitter.
After receiving the session identifier, the log transmitter performs the following step S2620:
step S2620, the log transmitter fills the session identifier of the session in the log.
The browser completes the marking of the log of the site page through step S2620. Then, step S2630 is performed:
step S2630, the log transmitter sends the log with the session identifier of the session to the log server.
Therefore, each log received by the log server is provided with the session identifier, and the log server can determine which logs belong to the same session through the session identifier, so that complete behavior data of the user in each session can be obtained. User preferences, user experience improvement, and the like may be analyzed using the behavioral data.
Steps S2300, S2400, S2500, and S2600 may be performed in parallel or in a certain order, and the order of the steps does not represent the order of execution.
It should be noted that, during a session, the step of initializing the log queue and/or the log transmitter may be performed only once, and if the log queue and/or the log transmitter has already been initialized, the step S2600 and/or the step S2610 may not need to be repeatedly performed.
< terminal device >
The embodiment provides a terminal device. As shown in fig. 5, the terminal apparatus 4100 includes:
a memory 4210 for storing executable instructions;
a processor 4220, under control of executable instructions, for performing a method comprising:
acquiring a site page, wherein a first script is embedded in the site page in advance;
when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance;
when the second script is executed, the session identification of the session is acquired from the local storage of the browser, and the session identification of the session is provided for the first script; and the number of the first and second groups,
when the first script is executed, the conversation mark of the conversation is used for marking the log of the website page, and the marked log is sent to the log server.
Preferably or optionally, the obtaining a session identifier of the session from a local storage of the browser includes:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, the obtaining of the session identifier of the current session from the third-party domain name storage area of the session storage area of the current session of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, creating a session identifier of the session, including:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
Preferably or optionally, the third-party domain page is a page deployed in the CDN network;
obtaining a third-party domain page, comprising: and acquiring a third-party domain page from a node server of the CDN.
Preferably or optionally, obtaining a third party domain page comprises:
and creating an iframe element to control the browser to acquire a third-party domain page and nest the third-party domain page into the site page.
Specifically, the embodiment of the user tracking method may be used to explain the terminal device of the embodiment, and details are not repeated in the embodiment of the terminal device.
The terminal apparatus 4100 may further include an interface device 4230, a communication device 4240, a display device 4250, an input device 4260, a speaker 4270, and a microphone 4280.
< Server >
The embodiment provides a server. As shown in fig. 6, the server 5100 includes:
a memory 5210 for storing executable instructions;
a processor 5220 configured to, under control of executable instructions, perform a method comprising:
a first script is embedded into a website page in advance, and the website page is issued to a browser; wherein the content of the first and second substances,
when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance;
when the second script is executed, the session identification of the session is acquired from the local storage of the browser, and the session identification of the session is provided for the first script; and the number of the first and second groups,
when the first script is executed, the conversation mark of the conversation is used for marking the log of the website page, and the marked log is sent to the log server.
Preferably or optionally, the obtaining a session identifier of the session from a local storage of the browser includes:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, the obtaining of the session identifier of the current session from the third-party domain name storage area of the session storage area of the current session of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
Preferably or optionally, creating a session identifier of the session, including:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
Preferably or optionally, the third-party domain page is a page deployed in the CDN network;
obtaining a third-party domain page, comprising: and acquiring a third-party domain page from a node server of the CDN.
Preferably or optionally, obtaining a third party domain page comprises:
and creating an iframe element to control the browser to acquire a third-party domain page and nest the third-party domain page into the site page.
Specifically, the embodiment of the user tracking method can be used to explain the server in the embodiment, and the description of the embodiment of the server is not repeated.
The server 5100 may also include an interface device 5230, a communication device 5250, a display device 5250, and an input device 5260.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (14)

1. A user behavior tracking method based on a browser comprises the following steps:
acquiring a site page, wherein a first script is embedded in the site page in advance;
when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance;
when the second script is executed, acquiring the session identifier of the session from the local storage of the browser, and providing the session identifier of the session to the first script; and the number of the first and second groups,
when the first script is executed, the log of the website page is marked by using the session identifier of the session, and the marked log is sent to a log server.
2. The method of claim 1, wherein the obtaining the session identifier of the current session from the local storage of the browser comprises:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser.
3. The method according to claim 2, wherein the obtaining the session identifier of the current session from the third party domain name storage area of the session storage area of the current session of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
4. The method of claim 3, wherein the creating the session identifier of the current session comprises:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
5. The method of any of claims 1-4, wherein the third-party domain page is a page deployed in a CDN network;
the acquiring of the third-party domain page comprises: and acquiring the third-party domain page from a node server of the CDN network.
6. The method of any of claims 1-4, wherein the obtaining a third-party domain page comprises:
and creating an iframe element to control the browser to acquire the third-party domain page and nest the third-party domain page into the site page.
7. A user behavior tracking method based on a browser comprises the following steps:
embedding a first script in a website page in advance, and issuing the website page to a browser; wherein the content of the first and second substances,
when the first script is executed, acquiring a third-party domain page, wherein a second script is embedded in the third-party domain page in advance;
when the second script is executed, acquiring the session identifier of the session from the local storage of the browser, and providing the session identifier of the session to the first script; and the number of the first and second groups,
when the first script is executed, the log of the website page is marked by using the session identifier of the session, and the marked log is sent to a log server.
8. The method of claim 7, wherein the obtaining the session identifier of the current session from the local storage of the browser comprises:
and calling a browser interface, and acquiring the session identifier of the current session from a third-party domain name storage area of the session storage area of the current session of the browser.
9. The method according to claim 8, wherein the obtaining the session identifier of the current session from the third party domain name storage area of the session storage area of the current session of the browser includes:
and if the third-party domain name storage area of the session storage area of the current session of the browser does not have the session identifier of the current session, creating the session identifier of the current session, and storing the created session identifier of the current session into the third-party domain name storage area of the session storage area of the current session of the browser.
10. The method of claim 9, wherein the creating the session identifier of the current session comprises:
calling a browser interface to acquire a random number and a current timestamp;
and creating a session identifier of the session by using the random number and the current timestamp according to an algorithm preset in the second script.
11. The method of any of claims 7-10, wherein the third party domain page is a page deployed in a CDN network;
the acquiring of the third-party domain page comprises: and acquiring the third-party domain page from a node server of the CDN network.
12. The method of any of claims 7-10, wherein the retrieving a third-party domain page comprises:
and creating an iframe element to control the browser to acquire the third-party domain page and nest the third-party domain page into the site page.
13. A terminal device, comprising:
a memory for storing executable instructions;
a processor for performing the method of any one of claims 1 to 6 under the control of the executable instructions.
14. A server, comprising:
a memory for storing executable instructions;
a processor for performing the method of any one of claims 7 to 12 under the control of the executable instructions.
CN201811474257.5A 2018-12-04 2018-12-04 User behavior tracking method based on browser, terminal device and server Active CN111277615B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811474257.5A CN111277615B (en) 2018-12-04 2018-12-04 User behavior tracking method based on browser, terminal device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811474257.5A CN111277615B (en) 2018-12-04 2018-12-04 User behavior tracking method based on browser, terminal device and server

Publications (2)

Publication Number Publication Date
CN111277615A CN111277615A (en) 2020-06-12
CN111277615B true CN111277615B (en) 2022-01-11

Family

ID=70999951

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811474257.5A Active CN111277615B (en) 2018-12-04 2018-12-04 User behavior tracking method based on browser, terminal device and server

Country Status (1)

Country Link
CN (1) CN111277615B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222349A (en) * 2007-01-12 2008-07-16 中国电信股份有限公司 Method and system for collecting web user action and performance data
CN101257538A (en) * 2008-03-25 2008-09-03 华为技术有限公司 Method and apparatus for processing request in browsers
CN102214090A (en) * 2010-04-09 2011-10-12 腾讯科技(深圳)有限公司 Method and device for creating session window
CN102521760A (en) * 2011-12-02 2012-06-27 互动通天图信息技术有限公司 User data acquisition method base on internet
CN103782294A (en) * 2011-06-30 2014-05-07 亚马逊技术有限公司 Remote browsing session management
CN105721578A (en) * 2016-02-17 2016-06-29 中国建设银行股份有限公司 User behavior data collection method and system
CN107797908A (en) * 2017-11-07 2018-03-13 南威软件股份有限公司 A kind of behavioral data acquisition method of website user
US10108432B1 (en) * 2009-04-16 2018-10-23 Intuit Inc. Generating a script based on user actions

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10664889B2 (en) * 2008-04-01 2020-05-26 Certona Corporation System and method for combining and optimizing business strategies

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101222349A (en) * 2007-01-12 2008-07-16 中国电信股份有限公司 Method and system for collecting web user action and performance data
CN101257538A (en) * 2008-03-25 2008-09-03 华为技术有限公司 Method and apparatus for processing request in browsers
US10108432B1 (en) * 2009-04-16 2018-10-23 Intuit Inc. Generating a script based on user actions
CN102214090A (en) * 2010-04-09 2011-10-12 腾讯科技(深圳)有限公司 Method and device for creating session window
CN103782294A (en) * 2011-06-30 2014-05-07 亚马逊技术有限公司 Remote browsing session management
CN102521760A (en) * 2011-12-02 2012-06-27 互动通天图信息技术有限公司 User data acquisition method base on internet
CN105721578A (en) * 2016-02-17 2016-06-29 中国建设银行股份有限公司 User behavior data collection method and system
CN107797908A (en) * 2017-11-07 2018-03-13 南威软件股份有限公司 A kind of behavioral data acquisition method of website user

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"On Web user tracking: How third-party http requests track users" browsing patterns for personalised advertising";Silvia Puglisi等;《 2016 Mediterranean Ad Hoc Networking Workshop (Med-Hoc-Net)》;20160804;全文 *
"一种基于用户浏览行为的数据采集方法";吴国芳等;《洛阳师范学院学报》;20140810;全文 *

Also Published As

Publication number Publication date
CN111277615A (en) 2020-06-12

Similar Documents

Publication Publication Date Title
US9553918B1 (en) Stateful and stateless cookie operations servers
CN104503780B (en) It is a kind of that method and apparatus that applying channel packet are provided
EP2659367B1 (en) Online privacy management
CN103078949B (en) The method and system of display telephone number information
KR102504075B1 (en) Matching and attributes of user device events
CN109152094B (en) Wireless network connection method for terminal
CN105446750B (en) The method and apparatus that WebApp starting runs, generates image file
CN105657479B (en) Video processing method and device
CN104965868A (en) Data inquiring and analyzing system and method based on WeChat public platform
CN104253741A (en) Information sending method and device and system thereof
CN104519050A (en) Login method and login system
CN104410546A (en) Testing method and device of real-time processing system
CN103765858A (en) A method and server for monitoring users during their browsing within a communications network
CN103605549A (en) Interface exit display method and device
US20150095487A1 (en) Third-party link tracker system and method
CN113656713B (en) Network resource processing method, device and system
CN114465867A (en) Server maintenance method and device, storage medium and processor
CN102769625A (en) Client-side Cookie information acquisition method and device
KR101744696B1 (en) Method, device, program and recording medium for filtering information
CN109587197B (en) Method, device and system for associating reported data
CN104639973B (en) Information pushing method and device
CN105554569A (en) Method, device and system for monitoring key quality indicator (KQI)
EP3593493B1 (en) Prediction of a performance indicator
CN111277615B (en) User behavior tracking method based on browser, terminal device and server
CN103246501A (en) Method and client-side for sharing application

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant