You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A [Simple Analytics](https://simpleanalytics.com/) source plugin for CloudQuery that loads raw page view and event data from Simple Analytics to any database, data warehouse or data lake supported by [CloudQuery](https://www.cloudquery.io/), such as PostgreSQL, BigQuery, Athena, and many more.
6
+
A [Simple Analytics](https://simpleanalytics.com/) source plugin for CloudQuery that loads raw page view and event data from Simple Analytics to any database, data warehouse or data lake supported by [CloudQuery](https://cloudquery.io/), such as PostgreSQL, BigQuery, Athena, and many more.
The following source configuration file will sync all data points for `mywebsite.com` to a PostgreSQL database. See [the CloudQuery Quickstart](https://www.cloudquery.io/docs/quickstart) for more information on how to configure the source and destination.
15
+
The following source configuration file will sync all data points for `mywebsite.com` to a PostgreSQL database. See [CloudQuery Quickstart](https://cloudquery.io/docs/quickstart) for more information on how to configure the source and destination.
16
16
17
17
```yaml
18
18
kind: source
19
19
spec:
20
-
name: "simpleanalytics"
21
-
path: "simpleanalytics/simpleanalytics"
22
-
version: "${VERSION}"
23
-
# backend: "local" # use this to enable incremental syncing
A user ID from Simple Analytics, obtained from the [account settings](https://simpleanalytics.com/account) page. It should start with `sa_user_id...`
45
48
46
-
-`api_key` (string, required):
49
+
-`api_key` (`string`) (required)
47
50
48
51
An API Key from Simple Analytics, obtained from the [account settings](https://simpleanalytics.com/account) page. It should start with `sa_api_key...`
49
52
50
-
-`websites` (array, required):
53
+
-`websites` (`list`) (required)
51
54
52
55
A list of websites to sync data for. Each website should have the following fields:
53
56
54
-
-`hostname` (string, required):
57
+
-`hostname` (`string`) (required)
55
58
56
59
The hostname of the website to sync data for. This should be the same as the hostname in Simple Analytics.
57
60
58
-
-`metadata_fields` (array[string], optional):
61
+
-`metadata_fields` (`[]string`) (optional)
59
62
60
63
A list of metadata fields to sync, e.g. `["path_text", "created_at_time"]`. If not specified, no metadata fields will be synced.
61
64
62
-
-`start_date` (string, optional):
65
+
-`start_date` (`string`) (optional)
63
66
64
67
The date to start syncing data from. If not specified, the plugin will sync data from the beginning of time (or use a start time defined by `period`, if set).
65
68
66
-
-`end_date` (string, optional):
69
+
-`end_date` (`string`) (optional)
67
70
68
71
The date to stop syncing data at. If not specified, the plugin will sync data until the current date.
69
72
70
-
-`period` (string, optional):
73
+
-`period` (`string`) (optional)
71
74
72
75
The duration of the time window to fetch historical data for, in days, months or years. It is used to calculate `start_date` if it is not specified. If `start_date` is specified, duration is ignored. Examples:
Best effort maximum number of Go routines to use. Lower this number to reduce memory usage.
77
83
78
84
## Incremental Syncing
79
85
80
86
The Simple Analytics plugin supports incremental syncing. This means that only new data points will be fetched from Simple Analytics and loaded into your destination. This is done by keeping track of the last date a sync was done, and only fetching new data from that date onwards.
81
-
To enable this, `backend` option must be set in the spec (as shown in the example config above). By default, incremental syncing is turned off. Also note that this will introduce duplicates, unless the destination is using `overwrite-delete-stale` mode. Care should be taken to remove these duplicates after loading them. For more information, see [Managing Incremental Tables](/docs/advanced-topics/managing-incremental-tables).
87
+
To enable this, `backend_options`must be set in the spec (as shown in the example config above). By default, incremental syncing is turned off. Also note that this will introduce duplicates, unless the destination is using `overwrite-delete-stale` mode. Care should be taken to remove these duplicates after loading them. For more information, see [Managing Incremental Tables](https://cloudquery.io/docs/advanced-topics/managing-incremental-tables).
82
88
83
89
## Example Queries
84
90
@@ -172,7 +178,25 @@ make gen-docs
172
178
### Release a new version
173
179
174
180
1. Run `git tag v1.0.0` to create a new tag for the release (replace `v1.0.0` with the new version number)
175
-
2. Run `git push origin v1.0.0` to push the tag to GitHub
181
+
2. Run `git push origin v1.0.0` to push the tag to GitHub
176
182
177
183
Once the tag is pushed, a new GitHub Actions workflow will be triggered to build the release binaries and create the new release on GitHub.
178
184
To customize the release notes, see the Go releaser [changelog configuration docs](https://goreleaser.com/customization/changelog/#changelog).
185
+
186
+
### Publish a new version to the Cloudquery Hub
187
+
188
+
After tagging a release, you can build and publish a new version to the [Cloudquery Hub](https://hub.cloudquery.io/) by running the following commands.
189
+
Replace `v1.0.0` with the new version number.
190
+
191
+
```bash
192
+
# -m parameter adds release notes message, output is created in dist/ directory
193
+
go run main.go package -m "Release v1.0.0" v1.0.0 .
194
+
195
+
# Login to cloudquery hub and publish the new version
196
+
cloudquery login -t simple-analytics
197
+
cloudquery plugin publish --finalize
198
+
```
199
+
200
+
After publishing the new version, it will [show up](https://hub.cloudquery.io/plugins/source/simple-analytics/simple-analytics) in the [hub](https://hub.cloudquery.io/).
201
+
202
+
For more information please refer to the official [Publishing a Plugin to the Hub](https://cloudquery.io/docs/developers/publishing-a-plugin-to-the-hub) guide.
0 commit comments