@blotoutio/providers-app-lovin-sdk 0.69.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/index.cjs.js +196 -0
- package/index.js +199 -0
- package/index.mjs +194 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# providers-app-lovin-sdk
|
|
2
|
+
|
|
3
|
+
This library was generated with [Nx](https://nx.dev).
|
|
4
|
+
|
|
5
|
+
## Building
|
|
6
|
+
|
|
7
|
+
Run `nx build providers-app-lovin-sdk` to build the library.
|
|
8
|
+
|
|
9
|
+
## Running unit tests
|
|
10
|
+
|
|
11
|
+
Run `nx test providers-app-lovin-sdk` to execute the unit tests via [Jest](https://jestjs.io).
|
package/index.cjs.js
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const packageName = 'appLovin';
|
|
4
|
+
|
|
5
|
+
const t = [
|
|
6
|
+
'https://s.axon.ai/pixel.js',
|
|
7
|
+
'https://c.albss.com/p/l/loader.iife.js',
|
|
8
|
+
];
|
|
9
|
+
const snippet = (axonEventKey) => {
|
|
10
|
+
if (!window || !document || window.axon) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
if (!window.axon) {
|
|
14
|
+
const a = (window.axon = function (...args) {
|
|
15
|
+
a.performOperation
|
|
16
|
+
? // eslint-disable-next-line prefer-spread,prefer-rest-params
|
|
17
|
+
a.performOperation.apply(a, args)
|
|
18
|
+
: // eslint-disable-next-line prefer-rest-params
|
|
19
|
+
a.operationQueue.push(arguments);
|
|
20
|
+
});
|
|
21
|
+
a.operationQueue = [];
|
|
22
|
+
a.ts = Date.now();
|
|
23
|
+
a.eventKey = axonEventKey;
|
|
24
|
+
let o = 0;
|
|
25
|
+
for (const script = document.getElementsByTagName('script')[0]; o < t.length; o++) {
|
|
26
|
+
const i = document.createElement('script');
|
|
27
|
+
i.async = !0;
|
|
28
|
+
i.src = t[o];
|
|
29
|
+
if (script && script.parentNode) {
|
|
30
|
+
script.parentNode.insertBefore(i, script);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const init = ({ manifest }) => {
|
|
36
|
+
if (!manifest.variables ||
|
|
37
|
+
!manifest.variables['eventKey'] ||
|
|
38
|
+
manifest.variables['enableBrowser'] !== '1') {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
snippet(manifest.variables['eventKey']);
|
|
42
|
+
if (!window.axon) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
window['axon']('init');
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getItems = (contents) => contents.map((item) => {
|
|
49
|
+
return {
|
|
50
|
+
item_id: item.id,
|
|
51
|
+
item_name: item.title || '',
|
|
52
|
+
price: item.item_price,
|
|
53
|
+
quantity: item.quantity,
|
|
54
|
+
image_url: item.image,
|
|
55
|
+
item_variant: item.variantId,
|
|
56
|
+
item_brand: item.brand,
|
|
57
|
+
item_category: item.category,
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
const getEventData = (eventName, userId, data) => {
|
|
61
|
+
switch (eventName) {
|
|
62
|
+
case 'AddToCart': {
|
|
63
|
+
return {
|
|
64
|
+
name: 'add_to_cart',
|
|
65
|
+
data: {
|
|
66
|
+
currency: data.currency,
|
|
67
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
68
|
+
value: data.value,
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
case 'InitiateCheckout': {
|
|
73
|
+
return {
|
|
74
|
+
name: 'begin_checkout',
|
|
75
|
+
data: {
|
|
76
|
+
currency: data.currency,
|
|
77
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
78
|
+
value: data.value,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
case 'Lead': {
|
|
83
|
+
return {
|
|
84
|
+
name: 'generate_lead',
|
|
85
|
+
data: {
|
|
86
|
+
currency: data.currency,
|
|
87
|
+
user_id: userId,
|
|
88
|
+
value: data.value,
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
case 'PageView': {
|
|
93
|
+
return {
|
|
94
|
+
name: 'page_view',
|
|
95
|
+
data: {},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
case 'Purchase': {
|
|
99
|
+
return {
|
|
100
|
+
name: 'purchase',
|
|
101
|
+
data: {
|
|
102
|
+
currency: data.currency,
|
|
103
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
104
|
+
transaction_id: data.orderId,
|
|
105
|
+
user_id: userId,
|
|
106
|
+
value: data.value,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
case 'RemoveFromCart': {
|
|
111
|
+
return {
|
|
112
|
+
name: 'remove_from_cart',
|
|
113
|
+
data: {
|
|
114
|
+
currency: data.currency,
|
|
115
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
116
|
+
value: data.value,
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
case 'Search': {
|
|
121
|
+
return {
|
|
122
|
+
name: 'search',
|
|
123
|
+
data: {
|
|
124
|
+
search_term: data.search,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
case 'CompleteRegistration': {
|
|
129
|
+
return {
|
|
130
|
+
name: 'sign_up',
|
|
131
|
+
data: {
|
|
132
|
+
user_id: userId,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
case 'ViewContent': {
|
|
137
|
+
return {
|
|
138
|
+
name: 'view_item',
|
|
139
|
+
data: {
|
|
140
|
+
currency: data.currency,
|
|
141
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
142
|
+
value: data.value,
|
|
143
|
+
},
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
case 'Subscribe': {
|
|
147
|
+
return {
|
|
148
|
+
name: 'subscribe',
|
|
149
|
+
data: {
|
|
150
|
+
currency: data.currency,
|
|
151
|
+
value: data.value,
|
|
152
|
+
user_id: userId,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
default: {
|
|
157
|
+
throw new Error(`Event: ${eventName} is not supported.`);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
const tag = ({ data, eventName, manifestVariables, userId }) => {
|
|
163
|
+
const payload = {
|
|
164
|
+
sdkVersion: "0.69.0" ,
|
|
165
|
+
};
|
|
166
|
+
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
167
|
+
try {
|
|
168
|
+
const { name, data: eventData } = getEventData(eventName, userId, data);
|
|
169
|
+
window.axon('track', name, eventData);
|
|
170
|
+
}
|
|
171
|
+
catch (e) {
|
|
172
|
+
console.log(e);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return payload;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
179
|
+
const data = {
|
|
180
|
+
name: packageName,
|
|
181
|
+
tag,
|
|
182
|
+
init,
|
|
183
|
+
};
|
|
184
|
+
try {
|
|
185
|
+
if (window) {
|
|
186
|
+
if (!window.edgetagProviders) {
|
|
187
|
+
window.edgetagProviders = [];
|
|
188
|
+
}
|
|
189
|
+
window.edgetagProviders.push(data);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch {
|
|
193
|
+
// No window
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
module.exports = data;
|
package/index.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
var ProvidersAppLovinSdk = (function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const packageName = 'appLovin';
|
|
5
|
+
|
|
6
|
+
const t = [
|
|
7
|
+
'https://s.axon.ai/pixel.js',
|
|
8
|
+
'https://c.albss.com/p/l/loader.iife.js',
|
|
9
|
+
];
|
|
10
|
+
const snippet = (axonEventKey) => {
|
|
11
|
+
if (!window || !document || window.axon) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (!window.axon) {
|
|
15
|
+
const a = (window.axon = function (...args) {
|
|
16
|
+
a.performOperation
|
|
17
|
+
? // eslint-disable-next-line prefer-spread,prefer-rest-params
|
|
18
|
+
a.performOperation.apply(a, args)
|
|
19
|
+
: // eslint-disable-next-line prefer-rest-params
|
|
20
|
+
a.operationQueue.push(arguments);
|
|
21
|
+
});
|
|
22
|
+
a.operationQueue = [];
|
|
23
|
+
a.ts = Date.now();
|
|
24
|
+
a.eventKey = axonEventKey;
|
|
25
|
+
let o = 0;
|
|
26
|
+
for (const script = document.getElementsByTagName('script')[0]; o < t.length; o++) {
|
|
27
|
+
const i = document.createElement('script');
|
|
28
|
+
i.async = !0;
|
|
29
|
+
i.src = t[o];
|
|
30
|
+
if (script && script.parentNode) {
|
|
31
|
+
script.parentNode.insertBefore(i, script);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const init = ({ manifest }) => {
|
|
37
|
+
if (!manifest.variables ||
|
|
38
|
+
!manifest.variables['eventKey'] ||
|
|
39
|
+
manifest.variables['enableBrowser'] !== '1') {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
snippet(manifest.variables['eventKey']);
|
|
43
|
+
if (!window.axon) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
window['axon']('init');
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const getItems = (contents) => contents.map((item) => {
|
|
50
|
+
return {
|
|
51
|
+
item_id: item.id,
|
|
52
|
+
item_name: item.title || '',
|
|
53
|
+
price: item.item_price,
|
|
54
|
+
quantity: item.quantity,
|
|
55
|
+
image_url: item.image,
|
|
56
|
+
item_variant: item.variantId,
|
|
57
|
+
item_brand: item.brand,
|
|
58
|
+
item_category: item.category,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
const getEventData = (eventName, userId, data) => {
|
|
62
|
+
switch (eventName) {
|
|
63
|
+
case 'AddToCart': {
|
|
64
|
+
return {
|
|
65
|
+
name: 'add_to_cart',
|
|
66
|
+
data: {
|
|
67
|
+
currency: data.currency,
|
|
68
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
69
|
+
value: data.value,
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
case 'InitiateCheckout': {
|
|
74
|
+
return {
|
|
75
|
+
name: 'begin_checkout',
|
|
76
|
+
data: {
|
|
77
|
+
currency: data.currency,
|
|
78
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
79
|
+
value: data.value,
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
case 'Lead': {
|
|
84
|
+
return {
|
|
85
|
+
name: 'generate_lead',
|
|
86
|
+
data: {
|
|
87
|
+
currency: data.currency,
|
|
88
|
+
user_id: userId,
|
|
89
|
+
value: data.value,
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
case 'PageView': {
|
|
94
|
+
return {
|
|
95
|
+
name: 'page_view',
|
|
96
|
+
data: {},
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
case 'Purchase': {
|
|
100
|
+
return {
|
|
101
|
+
name: 'purchase',
|
|
102
|
+
data: {
|
|
103
|
+
currency: data.currency,
|
|
104
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
105
|
+
transaction_id: data.orderId,
|
|
106
|
+
user_id: userId,
|
|
107
|
+
value: data.value,
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
case 'RemoveFromCart': {
|
|
112
|
+
return {
|
|
113
|
+
name: 'remove_from_cart',
|
|
114
|
+
data: {
|
|
115
|
+
currency: data.currency,
|
|
116
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
117
|
+
value: data.value,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
case 'Search': {
|
|
122
|
+
return {
|
|
123
|
+
name: 'search',
|
|
124
|
+
data: {
|
|
125
|
+
search_term: data.search,
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
case 'CompleteRegistration': {
|
|
130
|
+
return {
|
|
131
|
+
name: 'sign_up',
|
|
132
|
+
data: {
|
|
133
|
+
user_id: userId,
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
case 'ViewContent': {
|
|
138
|
+
return {
|
|
139
|
+
name: 'view_item',
|
|
140
|
+
data: {
|
|
141
|
+
currency: data.currency,
|
|
142
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
143
|
+
value: data.value,
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
case 'Subscribe': {
|
|
148
|
+
return {
|
|
149
|
+
name: 'subscribe',
|
|
150
|
+
data: {
|
|
151
|
+
currency: data.currency,
|
|
152
|
+
value: data.value,
|
|
153
|
+
user_id: userId,
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
default: {
|
|
158
|
+
throw new Error(`Event: ${eventName} is not supported.`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const tag = ({ data, eventName, manifestVariables, userId }) => {
|
|
164
|
+
const payload = {
|
|
165
|
+
sdkVersion: "0.69.0" ,
|
|
166
|
+
};
|
|
167
|
+
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
168
|
+
try {
|
|
169
|
+
const { name, data: eventData } = getEventData(eventName, userId, data);
|
|
170
|
+
window.axon('track', name, eventData);
|
|
171
|
+
}
|
|
172
|
+
catch (e) {
|
|
173
|
+
console.log(e);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return payload;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
180
|
+
const data = {
|
|
181
|
+
name: packageName,
|
|
182
|
+
tag,
|
|
183
|
+
init,
|
|
184
|
+
};
|
|
185
|
+
try {
|
|
186
|
+
if (window) {
|
|
187
|
+
if (!window.edgetagProviders) {
|
|
188
|
+
window.edgetagProviders = [];
|
|
189
|
+
}
|
|
190
|
+
window.edgetagProviders.push(data);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
// No window
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return data;
|
|
198
|
+
|
|
199
|
+
})();
|
package/index.mjs
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
const packageName = 'appLovin';
|
|
2
|
+
|
|
3
|
+
const t = [
|
|
4
|
+
'https://s.axon.ai/pixel.js',
|
|
5
|
+
'https://c.albss.com/p/l/loader.iife.js',
|
|
6
|
+
];
|
|
7
|
+
const snippet = (axonEventKey) => {
|
|
8
|
+
if (!window || !document || window.axon) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (!window.axon) {
|
|
12
|
+
const a = (window.axon = function (...args) {
|
|
13
|
+
a.performOperation
|
|
14
|
+
? // eslint-disable-next-line prefer-spread,prefer-rest-params
|
|
15
|
+
a.performOperation.apply(a, args)
|
|
16
|
+
: // eslint-disable-next-line prefer-rest-params
|
|
17
|
+
a.operationQueue.push(arguments);
|
|
18
|
+
});
|
|
19
|
+
a.operationQueue = [];
|
|
20
|
+
a.ts = Date.now();
|
|
21
|
+
a.eventKey = axonEventKey;
|
|
22
|
+
let o = 0;
|
|
23
|
+
for (const script = document.getElementsByTagName('script')[0]; o < t.length; o++) {
|
|
24
|
+
const i = document.createElement('script');
|
|
25
|
+
i.async = !0;
|
|
26
|
+
i.src = t[o];
|
|
27
|
+
if (script && script.parentNode) {
|
|
28
|
+
script.parentNode.insertBefore(i, script);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const init = ({ manifest }) => {
|
|
34
|
+
if (!manifest.variables ||
|
|
35
|
+
!manifest.variables['eventKey'] ||
|
|
36
|
+
manifest.variables['enableBrowser'] !== '1') {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
snippet(manifest.variables['eventKey']);
|
|
40
|
+
if (!window.axon) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
window['axon']('init');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const getItems = (contents) => contents.map((item) => {
|
|
47
|
+
return {
|
|
48
|
+
item_id: item.id,
|
|
49
|
+
item_name: item.title || '',
|
|
50
|
+
price: item.item_price,
|
|
51
|
+
quantity: item.quantity,
|
|
52
|
+
image_url: item.image,
|
|
53
|
+
item_variant: item.variantId,
|
|
54
|
+
item_brand: item.brand,
|
|
55
|
+
item_category: item.category,
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
const getEventData = (eventName, userId, data) => {
|
|
59
|
+
switch (eventName) {
|
|
60
|
+
case 'AddToCart': {
|
|
61
|
+
return {
|
|
62
|
+
name: 'add_to_cart',
|
|
63
|
+
data: {
|
|
64
|
+
currency: data.currency,
|
|
65
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
66
|
+
value: data.value,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
case 'InitiateCheckout': {
|
|
71
|
+
return {
|
|
72
|
+
name: 'begin_checkout',
|
|
73
|
+
data: {
|
|
74
|
+
currency: data.currency,
|
|
75
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
76
|
+
value: data.value,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
case 'Lead': {
|
|
81
|
+
return {
|
|
82
|
+
name: 'generate_lead',
|
|
83
|
+
data: {
|
|
84
|
+
currency: data.currency,
|
|
85
|
+
user_id: userId,
|
|
86
|
+
value: data.value,
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
case 'PageView': {
|
|
91
|
+
return {
|
|
92
|
+
name: 'page_view',
|
|
93
|
+
data: {},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
case 'Purchase': {
|
|
97
|
+
return {
|
|
98
|
+
name: 'purchase',
|
|
99
|
+
data: {
|
|
100
|
+
currency: data.currency,
|
|
101
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
102
|
+
transaction_id: data.orderId,
|
|
103
|
+
user_id: userId,
|
|
104
|
+
value: data.value,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
case 'RemoveFromCart': {
|
|
109
|
+
return {
|
|
110
|
+
name: 'remove_from_cart',
|
|
111
|
+
data: {
|
|
112
|
+
currency: data.currency,
|
|
113
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
114
|
+
value: data.value,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
case 'Search': {
|
|
119
|
+
return {
|
|
120
|
+
name: 'search',
|
|
121
|
+
data: {
|
|
122
|
+
search_term: data.search,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
case 'CompleteRegistration': {
|
|
127
|
+
return {
|
|
128
|
+
name: 'sign_up',
|
|
129
|
+
data: {
|
|
130
|
+
user_id: userId,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
case 'ViewContent': {
|
|
135
|
+
return {
|
|
136
|
+
name: 'view_item',
|
|
137
|
+
data: {
|
|
138
|
+
currency: data.currency,
|
|
139
|
+
items: data.contents ? getItems(data.contents) : [],
|
|
140
|
+
value: data.value,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
case 'Subscribe': {
|
|
145
|
+
return {
|
|
146
|
+
name: 'subscribe',
|
|
147
|
+
data: {
|
|
148
|
+
currency: data.currency,
|
|
149
|
+
value: data.value,
|
|
150
|
+
user_id: userId,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
default: {
|
|
155
|
+
throw new Error(`Event: ${eventName} is not supported.`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const tag = ({ data, eventName, manifestVariables, userId }) => {
|
|
161
|
+
const payload = {
|
|
162
|
+
sdkVersion: "0.69.0" ,
|
|
163
|
+
};
|
|
164
|
+
if (window.axon && manifestVariables['enableBrowser'] === '1') {
|
|
165
|
+
try {
|
|
166
|
+
const { name, data: eventData } = getEventData(eventName, userId, data);
|
|
167
|
+
window.axon('track', name, eventData);
|
|
168
|
+
}
|
|
169
|
+
catch (e) {
|
|
170
|
+
console.log(e);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return payload;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
// eslint-disable-next-line @nx/enforce-module-boundaries
|
|
177
|
+
const data = {
|
|
178
|
+
name: packageName,
|
|
179
|
+
tag,
|
|
180
|
+
init,
|
|
181
|
+
};
|
|
182
|
+
try {
|
|
183
|
+
if (window) {
|
|
184
|
+
if (!window.edgetagProviders) {
|
|
185
|
+
window.edgetagProviders = [];
|
|
186
|
+
}
|
|
187
|
+
window.edgetagProviders.push(data);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
catch {
|
|
191
|
+
// No window
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export { data as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blotoutio/providers-app-lovin-sdk",
|
|
3
|
+
"version": "0.69.0",
|
|
4
|
+
"description": "App Lovin Browser SDK for EdgeTag",
|
|
5
|
+
"author": "Blotout",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/blotoutio/edgetag-sdk",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"main": "./index.cjs.js",
|
|
12
|
+
"module": "./index.mjs",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/blotoutio/edgetag-sdk.git"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"index.js",
|
|
19
|
+
"index.cjs.js",
|
|
20
|
+
"index.mjs",
|
|
21
|
+
"package.json",
|
|
22
|
+
"README.md"
|
|
23
|
+
]
|
|
24
|
+
}
|