如何在 React Typescript 组件中引用 Adob​​e 分析全局对象?

问题描述

我们正在将 Adob​​e Analytics 添加到我们的 React JS (17) 应用程序中。我们在 src/index.html 文件添加了以下内容...

<!DOCTYPE html>
<html>
  <head>
    <Meta charset="utf-8" />
    <Meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
    <title>Upwise</title>
    ...

    <script src="//assets.adobedtm.com/launch-ourproprietaryappstuff-development.min.js"></script>
  </head>
  <body>
    ...
    <script type="text/javascript">_satellite.pageBottom();</script>
  </body>
</html>

通常 Adob​​e 建议可以像这样使用全局 _satellite 对象

_satellite && _satellite.track('test event',...

但我们使用的是 Typescripted 组件,我不确定如何在 Typescript 文件中引用全局 JS 对象。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)