Skip to content

customer.io identify + track action #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5773abe
first commit for customer.io integration
matteosdocsity Jun 18, 2021
10bb4ca
improved customer.io class
matteosdocsity Jun 18, 2021
1a01e12
improved customer.io code
matteosdocsity Jun 18, 2021
d38035b
lot of improvements for customerio Identify
matteosdocsity Jun 24, 2021
fddd9da
lot of improvements for customerio integration, trying to rate limit …
matteosdocsity Jun 29, 2021
7617db9
testing rate limit with promise.all
matteosdocsity Jul 1, 2021
23070b2
fixed customer.io timeout
matteosdocsity Jul 1, 2021
714a12f
cleaned code for customer.io action
matteosdocsity Jul 5, 2021
797a545
added customerio_track - updated dependency customerio-node
matteosdocsity Jul 8, 2021
44a02a7
improved customerio with https keepAlive connection
matteosdocsity Jul 9, 2021
0073024
improved customer.io integration with customer_io_looker_attribute_pr…
matteosdocsity Jul 12, 2021
9e64102
updated tests for customer.io
matteosdocsity Jul 22, 2021
8306d39
done tests for customer.io
matteosdocsity Jul 23, 2021
b3b9e68
cleaned code
matteosdocsity Jul 26, 2021
dca2186
cleaned code
matteosdocsity Jul 26, 2021
99ce2d9
cleaned logs for customer.io
matteosdocsity Jul 26, 2021
b94478f
cleaned tests for customer.io
matteosdocsity Jul 26, 2021
8c700c4
Merge branch 'looker:master' into master
matteosdocsity Oct 18, 2021
5c945a0
added _update true for custome.io identify in order to not create new…
matteosdocsity Oct 18, 2021
f601660
update customerio-node to 3.1.0
matteosdocsity Oct 18, 2021
3ae83bf
Merge branch 'master' into master
matteosdocsity Jan 24, 2022
613beec
merge from orginal complete
matteosdocsity Apr 27, 2022
54bf6f0
Merge branch 'looker-open-source-master'
matteosdocsity Apr 27, 2022
7efdb81
Made prepack for customerio
matteosdocsity Apr 27, 2022
90e6cb5
Merge branch 'master' into master
matteosdocsity May 3, 2022
5b04f84
Merge branch 'master' into master
matteosdocsity Jul 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions lib/actions/customerio/customerio.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { TrackClient } from "customerio-node";
import * as Hub from "../../hub";
interface CustomerIoFields {
idFieldNames: string[];
idField?: Hub.Field;
userIdField?: Hub.Field;
emailField?: Hub.Field;
}
export declare enum CustomerIoTags {
UserId = "user_id",
Email = "email"
}
export declare enum CustomerIoCalls {
Identify = "identify",
Track = "track"
}
export declare class CustomerIoAction extends Hub.Action {
allowedTags: CustomerIoTags[];
name: string;
label: string;
iconName: string;
description: string;
params: {
description: string;
label: string;
name: string;
required: boolean;
sensitive: boolean;
}[];
minimumSupportedLookerVersion: string;
supportedActionTypes: Hub.ActionType[];
usesStreaming: boolean;
extendedAction: boolean;
supportedFormattings: Hub.ActionFormatting[];
supportedVisualizationFormattings: Hub.ActionVisualizationFormatting[];
requiredFields: {
any_tag: CustomerIoTags[];
}[];
executeInOwnProcess: boolean;
supportedFormats: (request: Hub.ActionRequest) => Hub.ActionFormat[];
form(): Promise<Hub.ActionForm>;
execute(request: Hub.ActionRequest): Promise<Hub.ActionResponse>;
protected executeCustomerIo(request: Hub.ActionRequest, customerIoCall: CustomerIoCalls): Promise<Hub.ActionResponse>;
protected unassignedCustomerIoFieldsCheck(customerIoFields: CustomerIoFields | undefined): void;
protected taggedFields(fields: Hub.Field[], tags: string[]): Hub.Field[];
protected taggedField(fields: any[], tags: string[]): Hub.Field | undefined;
protected customerIoFields(fields: Hub.Field[]): CustomerIoFields;
protected filterJsonCustomerIo(jsonRow: any, customerIoFields: CustomerIoFields, fieldName: string): any;
protected prepareCustomerIoTraitsFromRow(row: Hub.JsonDetail.Row, fields: Hub.Field[], customerIoFields: CustomerIoFields, hiddenFields: string[], event: any, context: any, lookerAttributePrefix: string): any;
protected customerIoClientFromRequest(request: Hub.ActionRequest): TrackClient;
}
export {};
365 changes: 365 additions & 0 deletions lib/actions/customerio/customerio.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions lib/actions/customerio/customerio_error.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export declare class CustomerIoActionError extends Error {
constructor(message?: string);
}
10 changes: 10 additions & 0 deletions lib/actions/customerio/customerio_error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerIoActionError = void 0;
class CustomerIoActionError extends Error {
constructor(message) {
super(message);
Object.setPrototypeOf(this, new.target.prototype);
}
}
exports.CustomerIoActionError = CustomerIoActionError;
11 changes: 11 additions & 0 deletions lib/actions/customerio/customerio_track.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import * as Hub from "../../hub";
import { CustomerIoAction } from "./customerio";
export declare class CustomerIoTrackAction extends CustomerIoAction {
name: string;
label: string;
iconName: string;
description: string;
minimumSupportedLookerVersion: string;
execute(request: Hub.ActionRequest): Promise<Hub.ActionResponse>;
form(): Promise<Hub.ActionForm>;
}
57 changes: 57 additions & 0 deletions lib/actions/customerio/customerio_track.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerIoTrackAction = void 0;
const Hub = require("../../hub");
const customerio_1 = require("./customerio");
class CustomerIoTrackAction extends customerio_1.CustomerIoAction {
constructor() {
super(...arguments);
this.name = "customerio_track";
this.label = "Customer.io Track";
this.iconName = "customerio/customerio.png";
this.description = "Add traits via track to your customer.io users.";
this.minimumSupportedLookerVersion = "5.5.0";
}
execute(request) {
return __awaiter(this, void 0, void 0, function* () {
return this.executeCustomerIo(request, customerio_1.CustomerIoCalls.Track);
});
}
form() {
return __awaiter(this, void 0, void 0, function* () {
const form = new Hub.ActionForm();
form.fields = [
{
name: "event",
label: "Event",
description: "The name of the event you’re tracking.",
type: "string",
required: true,
},
{
description: "Override default api key",
label: "Override API Key",
name: "override_customer_io_api_key",
required: false,
}, {
description: "Override default site id",
label: "Override Site ID",
name: "override_customer_io_site_id",
required: false,
},
];
return form;
});
}
}
exports.CustomerIoTrackAction = CustomerIoTrackAction;
Hub.addAction(new CustomerIoTrackAction());
2 changes: 2 additions & 0 deletions lib/actions/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import "./amazon/amazon_s3";
import "./auger/auger_train";
import "./azure/azure_storage";
import "./braze/braze";
import "./customerio/customerio";
import "./customerio/customerio_track";
import "./datarobot/datarobot";
import "./digitalocean/digitalocean_droplet";
import "./digitalocean/digitalocean_object_storage";
Expand Down
2 changes: 2 additions & 0 deletions lib/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ require("./amazon/amazon_s3");
require("./auger/auger_train");
require("./azure/azure_storage");
require("./braze/braze");
require("./customerio/customerio");
require("./customerio/customerio_track");
require("./datarobot/datarobot");
require("./digitalocean/digitalocean_droplet");
require("./digitalocean/digitalocean_object_storage");
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"async-mutex": "^0.1.4",
"aws-sdk": "^2.732.0",
"azure-storage": "^2.10.3",
"customerio-node": "^3.3.0",
"base64-url": "^2.3.3",
"blocked-at": "^1.2.0",
"body-parser": "^1.19.0",
Expand Down
4 changes: 4 additions & 0 deletions src/actions/customerio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# customer.io
## Add identifiers to your customer.io users.

The customer.io action allows you to Identify users (tagged with either `email`, `user_id`) with additional fields via the customer.io API.
Binary file added src/actions/customerio/customerio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading