| | |
| | | <?php |
| | | namespace JVBase\integrations\services; |
| | | use Exception; |
| | | use JVBase\integrations\Integrations; |
| | | use WP_Error; |
| | | |
| | | if (!defined('ABSPATH')) { |
| | | exit; |
| | |
| | | */ |
| | | public function renderTrackingScript(): void |
| | | { |
| | | // Skip on local environments |
| | | if (JVB_TESTING) { |
| | | return; |
| | | } |
| | | if (!$this->isSetUp() || is_admin()) { |
| | | return; |
| | | } |
| | |
| | | $event = ''; |
| | | $type = ''; |
| | | |
| | | |
| | | if (is_singular([BASE . 'artist', BASE . 'partner'])) { |
| | | // Profile view |
| | | global $post; |
| | |
| | | $referer = $_SERVER['HTTP_REFERER']; |
| | | $site_url = get_site_url(); |
| | | |
| | | if (strpos($referer, $site_url) === false) { |
| | | if (!str_contains($referer, $site_url)) { |
| | | $domain = parse_url($referer, PHP_URL_HOST); |
| | | return $domain ?: 'external'; |
| | | } |
| | |
| | | /** |
| | | * Process queued operations |
| | | */ |
| | | public function processOperation(array|\WP_Error $result, object $operation, array $data): array|\WP_Error |
| | | public function processOperation(array|WP_Error $result, object $operation, array $data): array|WP_Error |
| | | { |
| | | $prefix = strtolower($this->service_name) . '_'; |
| | | |