You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`Anonymize User ID?` - check this option if you want to send user id with tracking requests in anonymized form. By default the regular id field from user table is sent.
127
+
*`Anonymize User ID?` - check this option if you want to send user id with tracking requests in anonymized form. By default, the regular id field from user table is sent.
128
+
*`Use Proxy` - check this option if you want each request sends by Web Components first reach the dedicated module controller which forwards it to the FACT-Finder.
129
+
**Note:** If you plan to use proxy, consider reading below paragraph as it requires full instruction how to enable it properly.
125
130
*`How to count single click on "Add to cart" button?` - select how would you like to count single click on "Add to cart" button
126
131
*`Send the SID as userId when user not logged in?`
127
132
133
+
#### Proxy
134
+
Proxy feature adds a oxid controller which serves as a middleware between Web Components and FACT-Finder®.
135
+
The data flow with proxy enabled is illustrated by the graph below.
Having a middleware controller brings many possibilities to customize the request and the response. You can use `EnrichProxyDataEvent` to enrich data received from FACT-Finder. You can find more
138
+
details about implementation [here](#enrich-data-received-from-fact-finder-in-proxycontroller).
139
+
In addition, if forwarded request does not result with a correct response, you can implement fallback strategy, starting from this point.
140
+
141
+
```php
142
+
//src/Controller/SearchResultController.php:84
143
+
protected function fallback(): void
144
+
{
145
+
//this function could be used to implement fallback logic in case of any communication error.
146
+
$this->showJsonAndExit('Error: Unable to process the request.');
147
+
}
148
+
```
149
+
150
+
To enable proxy you need to change your HTTP server configuration by adding rewrite rules.
151
+
This is necessary because Web Components appends a URL parts to the base URL making it unreadable by the Oxid.
152
+
This is because Oxid use query parameters `cl` and `fnc` to instantiate specific controller and execute its function.
153
+
There is no routing that use url parts, hence any AJAX requests must target index.php file with the aforementioned parameters.
154
+
Without these rules any request will lead to 404.
155
+
156
+
APACHE
157
+
158
+
```apache
159
+
RewriteRule ^(rest/v[0-9].*)$ index.php [L]
160
+
```
161
+
162
+
**Note:** Sending each request to FACT-Finder instance trough Shopware, you lose on performance as each request need to be handled first by HTTP server and then, by Shopware itself. This additional traffic could be easily avoided by not activating this feature if there's no clear reason to use it.
0 commit comments