|
1 | 1 | --- |
2 | 2 | description: >- |
3 | | - Learn how to use the Headless API to track page views, personalize content, and manage segmentation for visitors. |
| 3 | + Learn how to use the Headless API to track page views, personalize content, |
| 4 | + and manage segmentation for visitors. |
4 | 5 | --- |
5 | 6 |
|
6 | 7 | # Using the Marketing API |
@@ -59,54 +60,49 @@ To track a page view, send a POST request to: |
59 | 60 |
|
60 | 61 | `/umbraco/umarketingsuite/api/v1/analytics/pageview/trackpageview/client` |
61 | 62 |
|
62 | | -- Required: `url` property of the page that a user has visited in the site |
63 | | -- Optional: `reffererUrl` can be set to inform uMarketingSuite where the user came from. |
| 63 | +* Required: `url` property of the page that a user has visited in the site |
| 64 | +* Optional: `reffererUrl` can be set to inform uMarketingSuite where the user came from. |
64 | 65 |
|
65 | 66 | `/umbraco/umarketingsuite/api/v1/analytics/pageview/trackpageview/server` |
66 | 67 |
|
67 | | -- Useful when a frontend JAMStack Server such as a NuxtJS server or similar is being used. |
68 | | -- Can notify uMarketingSuite when a page view has taken place and provide extra information. |
69 | | -- Requests extra metadata like `headers`, `browserUserAgent`, `remoteClientAddress`, and `userIdentifier`. |
| 68 | +* Useful when a frontend JAMStack Server such as a NuxtJS server or similar is being used. |
| 69 | +* Can notify uMarketingSuite when a page view has taken place and provide extra information. |
| 70 | +* Requests extra metadata like `headers`, `browserUserAgent`, `remoteClientAddress`, and `userIdentifier`. |
70 | 71 |
|
71 | 72 | **Client and Server** |
72 | 73 |
|
73 | 74 | uMarketingSuite gathers information about visitors based on their requests, extracting details from your request like HTTPContext. |
74 | 75 |
|
75 | | -- **Client-side**: This version applies when you make an API call directly to Umbraco from your browser. In this case, all the request metadata, such as IP address, cookies, request headers, and so on, comes directly from your browser. |
76 | | - |
77 | | -- **Server-side**: If there is a server between the browser and Umbraco, like a NuxtJS server, the requests tracked are from the server rather than the browser. In this scenario, uMarketingSuite does not receive metadata from the end-client's requests. Instead, you can use the server version to add this additional metadata (headers, IP addresses, and so on) to your pageview tracking between the NuxtJS server and Umbraco. |
| 76 | +* **Client-side**: This version applies when you make an API call directly to Umbraco from your browser. In this case, all the request metadata, such as IP address, cookies, request headers, and so on, comes directly from your browser. |
| 77 | +* **Server-side**: If there is a server between the browser and Umbraco, like a NuxtJS server, the requests tracked are from the server rather than the browser. In this scenario, uMarketingSuite does not receive metadata from the end-client's requests. Instead, you can use the server version to add this additional metadata (headers, IP addresses, and so on) to your pageview tracking between the NuxtJS server and Umbraco. |
78 | 78 |
|
79 | 79 | ### Page Events |
80 | 80 |
|
81 | 81 | To track events, send a POST request to: |
82 | 82 |
|
83 | 83 | `/umbraco/umarketingsuite/api/v1/analytics/pageevent/trackpageevent` |
84 | 84 |
|
85 | | -- After tracking a pageview using the Analytics TrackPageview API as mentioned above, you will receive both an externalVisitorId and `pageviewId`. |
86 | | -- Requires a supplied pageview-Id header and a request body containing a `category`, `action` _(optional)_, `label` _(optional)_, and `timestamp` _(optional)_. |
| 85 | +* After tracking a pageview using the Analytics TrackPageview API as mentioned above, you will receive both an externalVisitorId and `pageviewId`. |
| 86 | +* Requires a supplied pageview-Id header and a request body containing a `category`, `action` _(optional)_, `label` _(optional)_, and `timestamp` _(optional)_. |
87 | 87 |
|
88 | 88 | Optionally, provide an External-Visitor-Id header in order to automatically update the in-memory visitor. This helps to automatically reflect segments involving events for said visitors. Without this parameter, the pageview must be flushed to the database (according to the configuration) before any segment-related information is updated. For example: personalization variants based on events. |
89 | 89 |
|
90 | 90 | ### Segmentation - Assets |
91 | 91 |
|
92 | | -`/umbraco/umarketingsuite/api/v1/segmentation/assets/item/{path}` |
93 | | -`/umbraco/umarketingsuite/api/v1/segmentation/assets/item/{id}` |
| 92 | +`/umbraco/umarketingsuite/api/v1/segmentation/assets/item/{path}` `/umbraco/umarketingsuite/api/v1/segmentation/assets/item/{id}` |
94 | 93 |
|
95 | 94 | These requests let you verify if a content page, by ID or Path, has a **JavaScript** or **CSS** variant available for page injection. |
96 | 95 |
|
97 | | -![]() |
| 96 | + |
98 | 97 |
|
99 | 98 | ### Segmentation - Content |
100 | 99 |
|
101 | | -`/umbraco/umarketingsuite/api/v1/segmentation/content/segments` |
102 | | -`/umbraco/umarketingsuite/api/v1/segmentation/content/segments/{path}` |
103 | | -`/umbraco/umarketingsuite/api/v1/segmentation/content/segments/{id}` |
| 100 | +`/umbraco/umarketingsuite/api/v1/segmentation/content/segments` `/umbraco/umarketingsuite/api/v1/segmentation/content/segments/{path}` `/umbraco/umarketingsuite/api/v1/segmentation/content/segments/{id}` |
104 | 101 |
|
105 | 102 | These requests return details about segments (personalization and A/B testing) configured for a page. This helps determine if content can be changed by uMarketingSuite or cached more aggressively. |
106 | 103 |
|
107 | 104 | ### Segmentation - Visitor |
108 | 105 |
|
109 | | -`/umbraco/umarketingsuite/api/v1/segmentation/content/activesegments/{path}` |
110 | | -`/umbraco/umarketingsuite/api/v1/segmentation/content/activesegments/{id}` |
| 106 | +`/umbraco/umarketingsuite/api/v1/segmentation/content/activesegments/{path}` `/umbraco/umarketingsuite/api/v1/segmentation/content/activesegments/{id}` |
111 | 107 |
|
112 | 108 | These requests return the segment (personalization and A/B testing) that the current visitor ID of that specific page belongs to based on its cookie. |
0 commit comments