1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "conversionGoal": "lead_submission",
12 "pages": [
13 {
14 "pageId": "lead-home",
15 "url": "https://example.com/offer",
16 "ok": true,
17 "adPromise": "Book a 15 minute product walkthrough",
18 "verifiedTrustEvidence": false,
19 "findings": [
20 {
21 "id": "fetch",
22 "status": "PASS",
23 "message": "The page returned HTTP 200."
24 },
25 {
26 "id": "message_match",
27 "status": "WARN",
28 "message": "Ad copy token overlap was 40 percent."
29 },
30 {
31 "id": "cta",
32 "status": "WARN",
33 "message": "Seven possible calls to action were detected."
34 },
35 {
36 "id": "form_length",
37 "status": "WARN",
38 "message": "The selected form contains ten required fields."
39 },
40 {
41 "id": "trust_signals",
42 "status": "FAIL",
43 "message": "No supported trust signal type was detected."
44 },
45 {
46 "id": "analytics",
47 "status": "PASS",
48 "message": "An analytics script was detected in HTML."
49 }
50 ]
51 },
52 {
53 "pageId": "contact",
54 "url": "https://example.com/contact",
55 "ok": false,
56 "findings": [
57 {
58 "id": "fetch",
59 "status": "FAIL",
60 "message": "The page could not be fetched."
61 },
62 {
63 "id": "cta",
64 "status": "FAIL",
65 "message": "The supplied audit has no recognized CTA."
66 }
67 ]
68 }
69 ]
70};
71
72
73const run = await client.actor("danielmichalek/landing-page-ab-hypothesis-generator").call(input);
74
75
76console.log('Results from dataset');
77console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
78const { items } = await client.dataset(run.defaultDatasetId).listItems();
79items.forEach((item) => {
80 console.dir(item);
81});
82
83