face-age 2.1.23 → 2.2.1

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 CHANGED
@@ -216,6 +216,86 @@ Enable or disable image uploads.
216
216
 
217
217
  Limit the types of skin issues displayed during analysis.
218
218
 
219
+ ## Analytics Integration
220
+
221
+ Face Age supports integration with Google Analytics (GTM) and Facebook Pixel to track user interactions and conversions.
222
+
223
+ ### Google Analytics (GTM)
224
+
225
+ To integrate Google Analytics, add the following options:
226
+
227
+ ```js
228
+ const options = {
229
+ elementId: 'FaceAge-module',
230
+ faceageId: '<Face Age Client ID>',
231
+ gtag: 'G-XXXXXXXXXX', // Your Google Analytics Measurement ID
232
+ gtagInsert: true, // Optional: Automatically inject GTM script (default: true)
233
+ gtagDataLayer: window.dataLayer, // Optional: Custom dataLayer (default: window.dataLayer)
234
+ };
235
+
236
+ const faceAge = new FaceAge(options);
237
+ faceAge.render();
238
+ ```
239
+
240
+ #### GTM Options
241
+
242
+ - **gtag** (`String`): Your Google Analytics Measurement ID (format: `G-XXXXXXXXXX`, `GT-XXXXXXXXXX`, or `GTM-XXXXXXXXXX`)
243
+ - **gtagInsert** (`Boolean`, optional): Automatically inject the GTM script into the page. Default: `true`
244
+ - **gtagDataLayer** (`Object`, optional): Custom dataLayer object. Default: `window.dataLayer`
245
+
246
+ ### Facebook Pixel
247
+
248
+ To integrate Facebook Pixel, add the following options:
249
+
250
+ ```js
251
+ const options = {
252
+ elementId: 'FaceAge-module',
253
+ faceageId: '<Face Age Client ID>',
254
+ fbPixel: '123456789012345', // Your Facebook Pixel ID
255
+ fbPixelInsert: true, // Optional: Automatically inject Facebook Pixel script (default: true)
256
+ };
257
+
258
+ const faceAge = new FaceAge(options);
259
+ faceAge.render();
260
+ ```
261
+
262
+ #### Facebook Pixel Options
263
+
264
+ - **fbPixel** (`String`): Your Facebook Pixel ID (numeric string)
265
+ - **fbPixelInsert** (`Boolean`, optional): Automatically inject the Facebook Pixel script into the page. Default: `true`
266
+
267
+ ### Using Both Analytics Services
268
+
269
+ You can use both Google Analytics and Facebook Pixel simultaneously:
270
+
271
+ ```js
272
+ const options = {
273
+ elementId: 'FaceAge-module',
274
+ faceageId: '<Face Age Client ID>',
275
+ gtag: 'G-XXXXXXXXXX',
276
+ gtagDataLayer: window.dataLayer,
277
+ fbPixel: '123456789012345',
278
+ };
279
+
280
+ const faceAge = new FaceAge(options);
281
+ faceAge.render();
282
+ ```
283
+
284
+ ### Tracked Events
285
+
286
+ Face Age automatically tracks the following user interactions:
287
+
288
+ - Quiz start and completion
289
+ - Quiz question views and choices
290
+ - Skin analysis start
291
+ - Photo selection and capture
292
+ - Results view
293
+ - Product views and interactions
294
+ - Add to cart actions
295
+ - Checkout button clicks
296
+ - Modal open/close events
297
+ - Download report actions
298
+
219
299
  ## API
220
300
 
221
301
  Once the image is analyzed, you can retrieve the results using the following commands:
package/dist/faceage.css CHANGED
@@ -1677,15 +1677,15 @@ body {
1677
1677
  .face_age .facePosition #assertive {
1678
1678
  top: 0px;
1679
1679
  left: 20%;
1680
- color: white;
1681
1680
  width: 60%;
1682
1681
  bottom: 0;
1683
1682
  display: flex;
1684
1683
  padding: 7% 0 10px;
1685
1684
  position: absolute;
1686
- font-size: 22px;
1687
1685
  text-align: center;
1688
1686
  align-items: center;
1687
+ color: white;
1688
+ font-size: 22px;
1689
1689
  text-shadow: rgba(0, 0, 0, 0.7) 1px 1px 2px;
1690
1690
  line-history: 34px;
1691
1691
  justify-content: center;