Skip to content

Commit 55297e1

Browse files
Update lifetime to correct maximum (#672)
* Update lifetime to correct maximum * Add a const to make code clearer * Lint fixes
1 parent b201f68 commit 55297e1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/actions/google/ads/lib/api_client.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class GoogleAdsApiClient {
5050
return this.apiCall(method, path, body);
5151
}
5252
async createUserList(targetCid, newListName, newListDescription, uploadKeyType, mobileAppId) {
53+
const MAX_CUSTOMER_MATCH_MEMBERSHIP_LIFE_SPAN_DAYS = 540;
5354
const method = "POST";
5455
const path = `customers/${targetCid}/userLists:mutate`;
5556
const body = {
@@ -60,7 +61,7 @@ class GoogleAdsApiClient {
6061
name: newListName,
6162
description: newListDescription,
6263
membership_status: "OPEN",
63-
membership_life_span: 10000,
64+
membership_life_span: MAX_CUSTOMER_MATCH_MEMBERSHIP_LIFE_SPAN_DAYS,
6465
crm_based_user_list: {
6566
upload_key_type: uploadKeyType,
6667
app_id: mobileAppId,

src/actions/google/ads/lib/api_client.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ interface Consent {
1111

1212
export class GoogleAdsApiClient {
1313

14-
constructor(readonly log: Logger, readonly accessToken: string
15-
, readonly developerToken: string, readonly loginCid?: string) {}
14+
constructor(readonly log: Logger, readonly accessToken: string,
15+
readonly developerToken: string, readonly loginCid?: string) {}
1616

1717
async listAccessibleCustomers() {
1818
const method = "GET"
@@ -58,6 +58,7 @@ export class GoogleAdsApiClient {
5858
}
5959

6060
async createUserList(targetCid: string, newListName: string, newListDescription: string, uploadKeyType: "MOBILE_ADVERTISING_ID" | "CONTACT_INFO", mobileAppId?: string) {
61+
const MAX_CUSTOMER_MATCH_MEMBERSHIP_LIFE_SPAN_DAYS = 540
6162
const method = "POST"
6263
const path = `customers/${targetCid}/userLists:mutate`
6364
const body = {
@@ -68,7 +69,7 @@ export class GoogleAdsApiClient {
6869
name: newListName,
6970
description: newListDescription,
7071
membership_status: "OPEN",
71-
membership_life_span: 10000,
72+
membership_life_span: MAX_CUSTOMER_MATCH_MEMBERSHIP_LIFE_SPAN_DAYS,
7273
crm_based_user_list: {
7374
upload_key_type: uploadKeyType,
7475
app_id: mobileAppId,

0 commit comments

Comments
 (0)