<?php

namespace App\Tracking;

use App\Facades\Settings;
use Illuminate\Contracts\Support\Arrayable;

class CallGearTracking implements Arrayable
{
    public function toArray()
    {
        $key = Settings::get('crm-callgear-key');

        return [
            [
                "body" => '(function(){
                   e=document.createElement("script");
                   e.type="text/javascript",
                   e.async=1,
                   e.src="https://app.callgear.com/static/cs.min.js?k=' . $key . '";
                   document.getElementsByTagName("head")[0].appendChild(e);
                 })();',
                'data-consent' => 'analytical'
            ]
        ];
    }
}
