惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
aimingoo的专栏
aimingoo的专栏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
博客园_首页
Google Online Security Blog
Google Online Security Blog
Hugging Face - Blog
Hugging Face - Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
Intezer
P
Palo Alto Networks Blog
V
Vulnerabilities – Threatpost
雷峰网
雷峰网
O
OpenAI News
SecWiki News
SecWiki News
小众软件
小众软件
酷 壳 – CoolShell
酷 壳 – CoolShell
美团技术团队
N
News | PayPal Newsroom
Project Zero
Project Zero
Forbes - Security
Forbes - Security
IT之家
IT之家
A
Arctic Wolf
WordPress大学
WordPress大学
Jina AI
Jina AI
T
Tor Project blog
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
博客园 - 聂微东
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Privacy International News Feed
Cloudbric
Cloudbric
G
GRAHAM CLULEY
博客园 - 叶小钗
H
Hacker News: Front Page
腾讯CDC
量子位
Help Net Security
Help Net Security
人人都是产品经理
人人都是产品经理
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
宝玉的分享
宝玉的分享
爱范儿
爱范儿
L
Lohrmann on Cybersecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
Recorded Future
Recorded Future
C
CERT Recently Published Vulnerability Notes

博客园 - 孤剑

谈谈微信支付曝出的漏洞 阿里云ACE深圳同城会 开始报名 How to use “svn add” recursively in Linux shell? Java反序列化漏洞执行命令回显实现及Exploit下载 在线测试 ssl 安全性 检测一下你的专业指数:2015年十大测试工具你认识几个? nginx用户认证配置( Basic HTTP authentication) FTP基础知识 FTP port(主动模式) pasv(被动模式) 及如何映射FTP 虚拟机评估——如何确定一个CPU核上部署的虚拟机数量? iptables防火墙原理详解 linux平台下防火墙iptables原理(转) 通过rinetd实现端口转发来访问内网的服务 nmap端口状态解析 每天一个linux命令(53):route命令 49 款开源办公软件 如何关闭Linux里边的selinux ? NMAP 基础教程 Linux下批量修改文件名(rename) 将 LDAP 目录用于 Samba 认证
CSS 埋点统计
孤剑 · 2018-01-19 · via 博客园 - 孤剑

原文地址: https://my.oschina.net/u/1778933/blog/1608904

CSS 埋点统计

当一个网站或者 App 的规模达到一定程度,需要分析用户在 App 或者网站的相应操作,则需要埋点统计用户行为,这个不用多说,具体实现有 JS 脚本写好埋点事件并调接口,今天 get 到一种新的埋点统计方式保证耳目一新。下面代码简单示范一下。

//index.html

<!DOCTYPE html>
<html>

    <head lang="en">
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <title>CSS埋点</title>
        <style>
            .background {
                background-size: 100% 100%;
                width: 100%;
                height: 100%;
                position: fixed;
                z-index: -100;
            }

            html {
                background-color: #fff;
            }

            .notice-content {
                border: 1px #ccc solid;
                padding: 19px;
                border-radius: 10px;
                width: 80%;
                margin-left: 10%;
                margin-top: 10%;
            }

            .check-content {
                padding: 0!important;
                width: 80%!important;
                margin-left: 25px;
                margin-top: 10px;
            }

            .confirm {
                float: left;
                position: relative!important;
                left: 6%;
                height: 32px!important;
                line-height: 32px!important;
            }

            .btn {
                border: 1px solid #ff6689;
                background-color: #ff6689;
                width: 60%;
                margin-left: 20%;
                margin-top: 36px;
                font-size: 16px;
                font-weight: bold;
                color: #FFFFFF;
            }

            .title {
                display: block;
                text-align: center;
                font-size: 20px;
                margin-bottom: 19px;
            }

            span {
                display: block;
                margin-bottom: 7px;
            }

            .mui-checkbox input[type=checkbox]:checked:before,
            .mui-radio input[type=radio]:checked:before {
                color: #ff6689;
            }

            .body-content {
                width: 100%;
                height: 100%;
            }

            body {
                background-color: rgba(239, 239, 244, 0)!important;
            }

            .link:active::after{
                margin: 100px 100px;
                color: red;
                content: url("http://192.168.1.100:8888/Hotels_Server/view/count.php?action=visit");
            }
        </style>
    </head>

    <body>
        <divclass="loading">
            </div>
        <divstyle=""class="body-content">
            <divclass="background">
                </div>

            <divclass="notice-content">
                <labelclass="title">登记须知</label>
                <span>1.本次登记仅限于中国地区。</span>
                <span>2.完成登记审核通过后,生育登记服务卡可到乡(镇、街道)直接领取,也可选择邮寄到付快递给申请人。</span>
                <span>3.申请登记信息需真实完整,如有虚假,申请人将承担相应的法律责任。</span>
            </div>
            <aclass="link title">访问</a>
        </div>
    </body>
</html>
//count.php
<?php
/**
 * Created by PhpStorm.
 * User: geek
 * Date: 2018/1/18
 * Time: 上午9:56
 */

    $actionName =  $_REQUEST["action"];

    

css点击统计

php代码统计

说明

  • 当然这种方式使用比较简单的事件埋点。复杂的话还是需要 JS 操作。
  • JS 埋点统计用户可以通过浏览器禁用,CSS的话没办法禁用