reactjs - 使用 Infinite Scroll 将广告放入 React SPA
问题描述
我有一个 React Single Page Web App,它看起来像一个非常简化的酒店/航班搜索页面。用户选择标签作为过滤器,过滤后的结果以无限滚动的方式显示。Whenever a filter is selected or user scrolls to the bottom, SPA fetches data from my backend server, and the React App's states is changed, thus updating the display. 我的 React 静态页面也由我的后端提供。
我正在考虑在每 10 个左右的结果之间添加一个广告。
但是,我主要担心的是,由于我只有一个 HTML 文件(因为一切都由 React 处理),因此广告展示次数的方式可能会被错误地计算。或者更糟糕的是,我的网站可能没有资格展示广告。
谁能给我一些建议?非常感谢!
解决方案
推荐阅读
- ios - 如何将 ObservableObject 与 UIViewRepresentable 一起使用
- javascript - 使用JS的数据表添加列
- reactjs - 如何使用 Visual Studio 2017 调试在 CEFSharp 浏览器控件中运行的 TypeScript 代码(.tsx 文件)?
- c++ - 我正在编写一个代码来将一个 int 数组存储在一个文件中,然后在 c++ 中检索它,但是在检索第一项是虚假值时,我该如何解决这个问题?
- javascript - 动态创建的 boostrap 4 卡显示为列而不是正常布局(行)
- python - 需要 Django 权限
- javascript - 仅更新我更改其他状态的日期不应更新或更改 ReactJS/React-Hooks
- c# - 如何只刷新一个包含highchart图例而不是整个页面的更新面板?
- scala - Mill Build Tool,如何使用“驱逐”
- json - BigQuery 到 GCS JSON