1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = { "journeys": [
9 {
10 "name": "Lead form (accept all)",
11 "startUrl": "https://www.example.com/contact",
12 "consent": "accept",
13 "steps": [
14 {
15 "action": "fill",
16 "selector": "input[name=email]",
17 "value": "{{email}}",
18 },
19 {
20 "action": "fill",
21 "selector": "input[name=name]",
22 "value": "{{name}}",
23 },
24 {
25 "action": "click",
26 "selector": "button[type=submit]",
27 },
28 {
29 "action": "waitForUrl",
30 "url": "/thank",
31 },
32 ],
33 "expectedEvents": [
34 {
35 "platform": "ga4",
36 "event": "generate_lead",
37 "afterStep": 3,
38 },
39 {
40 "platform": "meta",
41 "event": "Lead",
42 "afterStep": 3,
43 "params": { "eid": "*" },
44 },
45 {
46 "platform": "google-ads",
47 "conversionLabel": "YOUR_LABEL",
48 },
49 ],
50 },
51 {
52 "name": "Home page (reject all)",
53 "startUrl": "https://www.example.com/",
54 "consent": "reject",
55 "steps": [{ "action": "scroll" }],
56 "expectedEvents": [],
57 },
58 ] }
59
60
61run = client.actor("siteverdict/siteverdict-tracking-qa-robot").call(run_input=run_input)
62
63
64print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
65for item in client.dataset(run.default_dataset_id).iterate_items():
66 print(item)
67
68