Skip to content

Commit

Permalink
support for pendo and heap
Browse files Browse the repository at this point in the history
  • Loading branch information
skarim committed Aug 27, 2024
1 parent 57febab commit 5dbaa04
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,22 @@ posthog.capture('<event_name>', {
```


#### Pendo
```js
pendo.track('<event_name>', {
<event_parameters>
});
```


#### Heap
```js
heap.track('<event_name>', {
<event_parameters>
});
```


#### Snowplow
```js
snowplow('trackStructEvent', {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flisk/analyze-tracking",
"version": "0.2.1",
"version": "0.2.2",
"description": "Analyzes tracking code in a project and generates data schemas",
"main": "src/index.js",
"bin": {
Expand Down
2 changes: 2 additions & 0 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
"rudderstack",
"mparticle",
"posthog",
"pendo",
"heap",
"snowplow",
"unknown"
],
Expand Down
4 changes: 4 additions & 0 deletions src/analyze/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ function detectSourceJs(node) {
if (objectName === 'rudderanalytics' && methodName === 'track') return 'rudderstack';
if (objectName === 'mParticle' && methodName === 'logEvent') return 'mparticle';
if (objectName === 'posthog' && methodName === 'capture') return 'posthog';
if (objectName === 'pendo' && methodName === 'track') return 'pendo';
if (objectName === 'heap' && methodName === 'track') return 'heap';
} else if (node.callee.type === 'Identifier' && node.callee.name === 'snowplow') {
return 'snowplow';
}
Expand All @@ -37,6 +39,8 @@ function detectSourceTs(node) {
if (objectName === 'rudderanalytics' && methodName === 'track') return 'rudderstack';
if (objectName === 'mParticle' && methodName === 'logEvent') return 'mparticle';
if (objectName === 'posthog' && methodName === 'capture') return 'posthog';
if (objectName === 'pendo' && methodName === 'track') return 'pendo';
if (objectName === 'heap' && methodName === 'track') return 'heap';
} else if (ts.isIdentifier(node.expression) && node.expression.escapedText === 'snowplow') {
return 'snowplow';
}
Expand Down

0 comments on commit 5dbaa04

Please sign in to comment.