AI traffic
Install on OpenCart
A folder next to index.php, loaded before OpenCart — no extension, on OpenCart 2, 3 and 4.
It is not an OpenCart extension: it is a folder PHP loads before the shop, on every request, through
auto_prepend_file. It works the same on OpenCart 2, 3 and 4 and survives theme and extension changes.
Requirements: PHP 8.1 or newer for the shop (on older PHP the file loads and does nothing); the PHP curl
extension or allow_url_fopen.
Install
-
Create a key in Survelium → Brand settings → Integrations → Create key. It is shown once.
-
Upload the folder. Download
survelium-agent-analytics-opencart-x.y.z.zipfrom Releases and extract it next to OpenCart'sindex.php(usuallypublic_html), so you getpublic_html/survelium/survelium.php. -
Configure. Copy
survelium/config.example.phptosurvelium/config.phpand paste the key intoapi_key.- Renamed the admin folder? Put its path in
deny_paths, e.g.['/my-admin']. - Behind Cloudflare? Set
'ip_header' => 'HTTP_CF_CONNECTING_IP', or crawlers cannot be verified.
- Renamed the admin folder? Put its path in
-
Load it before OpenCart, with the absolute path to
survelium.php. One of:-
.user.ininext toindex.php(PHP-FPM, most cPanel and LiteSpeed hosts; cPanel → MultiPHP INI Editor writes the same thing):auto_prepend_file = "/home/USER/public_html/survelium/survelium.php"PHP re-reads
.user.inievery few minutes (300 seconds by default). -
.htaccess(Apache with mod_php, LiteSpeed). OpenCart ships it as.htaccess.txt; if you never renamed it, create.htaccesswith just this line:php_value auto_prepend_file "/home/USER/public_html/survelium/survelium.php"If the shop answers 500 Internal Server Error right after, your host runs PHP-FPM: remove the line and use
.user.iniinstead.
Not sure of the absolute path? It is the folder shown in your hosting file manager, or
pwdover SSH. -
-
Check. Open a few shop pages. Within about 15 minutes, Brand settings → Integrations shows the key as used. With SSH:
php survelium/status.php # what is buffered, last send, last error php survelium/status.php --send # send now
The survelium folder ships an .htaccess that blocks web access to it (your key, the buffer). On nginx, point
storage_path outside the web root, or deny /survelium/ in the server block.
What it counts
Page views only (GET/HEAD, not the cart's AJAX calls or form posts), and nothing under /admin. Sending happens
after the page has gone out, in batches.
Update
Extract the new zip over the old folder. config.php is not in the zip, so your settings stay.
Uninstall
Remove the auto_prepend_file line first, then delete the survelium folder. The other way around, PHP fails on
every request until the line is gone.