GitXplorerGitXplorer
w

wx-amplitude

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
2282dce1825598736d2b82ba8e3521b78faf4638

Create README.md

wwangxiao committed 7 years ago
Unverified
9c8300879fad1f6d873f15ccf31636b103424810

1.0

wwangxiao committed 7 years ago
Unverified
3c0b575b6923c1268fa9c047fbd957b87f7ec80f

Initial commit

wwangxiao committed 7 years ago

README

The README file for this repository.

wx-amplitude

Amplitude SDK for WeChat small app. 微信小程序中使用的 Amplitude SDK。

配置

在微信小程序中,需要设置请求域,这个域要求必须是备案的域名,所以需要设置一个已备案的服务器做转发(在 Nginx 中直接转发即可)

使用

在小程序中引入对应的文件,按照以下方式使用

const Amplitude = require('./libs/wx-amplitude').default;
const amplitude = Amplitude({
  // the proxy of amplitude api server
  apiUrl: 'xxxxx',
  // change to the userId
  userId: 'wangxiao123',
  // change to your apiKey
  apiKey: 'api-key-xxxxxxx',
  // change to your app version
  version: '1.2.3',
});
amplitude.track('wangxiaotest', {
  // custom event properties
  aaa: 123,
});