{"id":3904,"date":"2026-10-07T09:03:32","date_gmt":"2026-10-07T09:03:32","guid":{"rendered":"https:\/\/gaconnector.com\/docs\/?p=3904"},"modified":"2026-10-07T10:20:31","modified_gmt":"2026-10-07T10:20:31","slug":"server-side-tracking-for-php","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/server-side-tracking-for-php\/","title":{"rendered":"Server-Side Tracking for PHP: Capture UTM Parameters and Lead Sources in Your CRM"},"content":{"rendered":"\r\n<p>If your website runs on PHP and you\u2019re not using WordPress, you can use GA Connector\u2019s server-side tracking library to capture where your leads came from and send that information to your CRM.<\/p>\r\n\r\n\r\n\r\n<p>It captures attribution data such as UTM parameters, Google Ads click IDs (gclid), landing pages, and referrers.<\/p>\r\n\r\n\r\n\r\n<p>The library works with Laravel, Symfony, CodeIgniter, and regular PHP websites. It\u2019s free and open source and can be installed with Composer.<\/p>\r\n\r\n\r\n\r\n<div class=\"gac-callout gac-note\"><strong><span class=\"gac-label\">Using WordPress? <\/span><\/strong>You don\u2019t need this library. Use the GA Connector WordPress plugin instead.<\/div>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Why use server-side tracking?<\/h2>\r\n\r\n\r\n\r\n<p>With regular browser-based tracking, some attribution data can be lost because of ad blockers and browser privacy features.<\/p>\r\n\r\n\r\n\r\n<p>Server-side tracking helps reduce this by routing tracking requests through your own website before sending the data to GA Connector.<\/p>\r\n\r\n\r\n\r\n<p>This gives you a few advantages:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><strong>More complete attribution:<\/strong> Because requests go through your own domain, they\u2019re less likely to be blocked by browser privacy features or ad blockers.<\/li>\r\n\r\n\r\n\r\n<li><strong>Works without WordPress:<\/strong> You can use GA Connector on any supported PHP website.<\/li>\r\n\r\n\r\n\r\n<li><strong>Works with your existing CRM:<\/strong> The attribution data is sent to your existing GA Connector integration and appears in the same reports.<\/li>\r\n\r\n\r\n\r\n<li><strong>Keeps your API key private:<\/strong> Your GA Connector API key stays on your server and isn\u2019t exposed in your website\u2019s browser code.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">How does it work?<\/h2>\r\n\r\n\r\n\r\n<p>The setup looks like this:<\/p>\r\n\r\n\r\n\r\n<p><strong>Visitor \u2192 Your website \u2192 GA Connector \u2192 Your CRM<\/strong><\/p>\r\n\r\n\r\n\r\n<p>When someone visits your website, your server handles the tracking request and forwards the information to GA Connector.<\/p>\r\n\r\n\r\n\r\n<p>When that visitor submits a form, GA Connector can connect the lead with the attribution information collected during their visit.<\/p>\r\n\r\n\r\n\r\n<p>The visitor\u2019s browser doesn\u2019t need to send tracking requests directly to a third-party tracking domain.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">What does my developer need to do?<\/h2>\r\n\r\n\r\n\r\n<p>The library doesn\u2019t start tracking automatically after installation. A developer needs to connect it to your website.<\/p>\r\n\r\n\r\n\r\n<p>The library handles:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Loading the GA Connector tracking code<\/li>\r\n\r\n\r\n\r\n<li>Forwarding tracking data through your domain<\/li>\r\n\r\n\r\n\r\n<li>Adding your GA Connector API key securely<\/li>\r\n\r\n\r\n\r\n<li>Checking that your account and domain are configured correctly<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>Your developer needs to:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Add the tracking code to the pages you want to track<\/li>\r\n\r\n\r\n\r\n<li>Create a tracking route on your domain, such as <code>yoursite.com\/gac<\/code><\/li>\r\n\r\n\r\n\r\n<li>Connect the tracker to your cookie consent setup, if you use one<\/li>\r\n\r\n\r\n\r\n<li>Make sure the configuration works with your website\u2019s caching setup<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>For most PHP websites, this is a relatively small implementation: usually a line in your main template and a new route.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Supported CRMs<\/h2>\r\n\r\n\r\n\r\n<p>Server-side tracking works with the CRMs supported by GA Connector, including:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Salesforce<\/li>\r\n\r\n\r\n\r\n<li>Zoho CRM<\/li>\r\n\r\n\r\n\r\n<li>Pipedrive<\/li>\r\n\r\n\r\n\r\n<li>Close<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>You don\u2019t need a separate CRM integration for server-side tracking.<\/p>\r\n\r\n\r\n\r\n<p>The PHP library collects the attribution data differently, but the information still goes to your existing GA Connector account and CRM integration.<\/p>\r\n\r\n\r\n\r\n<p>Your lead records can include information such as:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>UTM source<\/li>\r\n\r\n\r\n\r\n<li>UTM medium<\/li>\r\n\r\n\r\n\r\n<li>UTM campaign<\/li>\r\n\r\n\r\n\r\n<li>Google Ads click ID (gclid)<\/li>\r\n\r\n\r\n\r\n<li>Landing page<\/li>\r\n\r\n\r\n\r\n<li>Referrer<\/li>\r\n<\/ul>\r\n\r\n\r\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Install the PHP tracking library<\/h2>\r\n\r\n\r\n\r\n<p><em>The following section is intended for developers implementing the library.<\/em><\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Requirements<\/h3>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<thead>\r\n<tr>\r\n<th>Requirement<\/th>\r\n<th>Details<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td>PHP<\/td>\r\n<td>PHP 7.4 or newer (tested on PHP 7.4 and 8.3)<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Composer<\/td>\r\n<td>Used to install the library<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Additional software<\/td>\r\n<td>None. The library uses cURL when available but can work without it<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>GA Connector<\/td>\r\n<td>Your GA Connector API key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td>Domain<\/td>\r\n<td>Your website must be added as an allowed domain in your GA Connector account<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">1. Install the package<\/h3>\r\n\r\n\r\n\r\n<p>Run this command from your project folder:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:sh decode:true\">composer require gaconnector\/server-side-tracking<\/pre>\r\n\r\n\r\n\r\n<p>If your application doesn\u2019t already load Composer packages, add:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">require __DIR__ . '\/vendor\/autoload.php';<\/pre>\r\n\r\n\r\n\r\n<p><strong>Tip:<\/strong> Store your API key in an environment variable such as <code>GAC_API_KEY<\/code> instead of adding it directly to your code.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">2. Connect the library to GA Connector<\/h3>\r\n\r\n\r\n\r\n<p>Add the following code to a file that runs on every request, such as your application\u2019s bootstrap or configuration file:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">&lt;?php\r\n\r\n\/\/ bootstrap.php\r\nrequire __DIR__ . '\/vendor\/autoload.php';\r\n\r\nuse GaConnector\\Tracking\\GaConnector;\r\n\r\nGaConnector::configure([\r\n    'apiKey'  =&gt; getenv('GAC_API_KEY'),\r\n    'baseUrl' =&gt; 'https:\/\/example.com\/gac',\r\n]);<\/pre>\r\n\r\n\r\n\r\n<p>Replace <code>example.com<\/code> with your own domain.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">3. Add tracking to your pages<\/h3>\r\n\r\n\r\n\r\n<p>Add the GA Connector tracking code to your main page template.<\/p>\r\n\r\n\r\n\r\n<p>You can place it inside <code>&lt;head&gt;<\/code> or just before <code>&lt;\/body&gt;<\/code>:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">&lt;?php require __DIR__ . '\/bootstrap.php'; ?&gt;\r\n\r\n&lt;!doctype html&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;title&gt;Contact us&lt;\/title&gt;\r\n\r\n    &lt;?= \\GaConnector\\Tracking\\GaConnector::html() ?&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n    &lt;!-- your page and lead form --&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\r\n\r\n\r\n\r\n<p>Every page using this template will now include the tracker.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">4. Create the tracking route<\/h3>\r\n\r\n\r\n\r\n<p>Create a small PHP file that handles GA Connector tracking requests:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">&lt;?php\r\n\r\n\/\/ gac.php\r\nrequire __DIR__ . '\/bootstrap.php';\r\n\r\n\\GaConnector\\Tracking\\GaConnector::serve();<\/pre>\r\n\r\n\r\n\r\n<p>Then route requests under <code>\/gac\/<\/code> to this file.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">Apache<\/h4>\r\n\r\n\r\n\r\n<pre class=\"lang:apache decode:true\">RewriteEngine On\r\nRewriteRule ^gac\/ gac.php [L,QSA]<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">nginx<\/h4>\r\n\r\n\r\n\r\n<pre class=\"lang:default decode:true\">location \/gac\/ {\r\n    try_files $uri \/gac.php?$query_string;\r\n}<\/pre>\r\n\r\n\r\n\r\n<p>Your website will now handle these tracking endpoints:<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<thead>\r\n<tr>\r\n<th>Address<\/th>\r\n<th>Purpose<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td><code>GET \/gac\/js<\/code><\/td>\r\n<td>Loads the GA Connector tracker through your domain<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>POST \/gac\/events\/pageview<\/code><\/td>\r\n<td>Records a page view<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>POST \/gac\/events\/identify<\/code><\/td>\r\n<td>Connects a form submission to the visitor\u2019s lead source using a hashed email<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">5. Check that everything is working<\/h3>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">Check your account connection<\/h4>\r\n\r\n\r\n\r\n<p>You can verify that your API key and domain are configured correctly from an admin or setup page.<\/p>\r\n\r\n\r\n\r\n<p><strong>Do not add this code to a public page.<\/strong><\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">use GaConnector\\Tracking\\GaConnector;\r\nuse GaConnector\\Tracking\\Exception\\AccountVerificationException;\r\nuse GaConnector\\Tracking\\Exception\\NoHttpTransportException;\r\n\r\ntry {\r\n    $account = GaConnector::verifyAccount('example.com');\r\n\r\n    echo $account-&gt;allows('example.com')\r\n        ? 'Connected'\r\n        : 'Domain not added to this account';\r\n\r\n} catch (AccountVerificationException $e) {\r\n    \/\/ 401 = wrong API key\r\n    \/\/ 403 = subscription inactive\r\n    \/\/ 404 = account not found\r\n\r\n    echo 'Connection failed: ' . $e-&gt;getStatus();\r\n\r\n} catch (NoHttpTransportException $e) {\r\n    echo 'Your server cannot make outgoing requests';\r\n}<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">Check a live page<\/h4>\r\n\r\n\r\n\r\n<ol class=\"wp-block-list\">\r\n<li>Open a page where tracking is installed.<\/li>\r\n\r\n\r\n\r\n<li>Open your browser\u2019s Developer Tools (<code>F12<\/code>).<\/li>\r\n\r\n\r\n\r\n<li>Open the <strong>Console<\/strong>.<\/li>\r\n\r\n\r\n\r\n<li>Enter:<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<pre class=\"lang:js decode:true\">window.__gacStatus<\/pre>\r\n\r\n\r\n\r\n<p>If the result is <code>ok<\/code>, tracking is working.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Advanced setup<\/h2>\r\n\r\n\r\n\r\n<p>The setup above should be enough for most websites. The following options are available for websites that need additional configuration.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Laravel, Symfony, and other PHP frameworks<\/h3>\r\n\r\n\r\n\r\n<p>The library works with PHP frameworks such as Laravel and Symfony.<\/p>\r\n\r\n\r\n\r\n<p>Add the tracking code to your framework\u2019s main layout and create a route for <code>\/gac\/*<\/code>.<\/p>\r\n\r\n\r\n\r\n<p>If your framework already provides the incoming request, you can call the handlers directly:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">use GaConnector\\Tracking\\Http\\Request;\r\n\r\n$response = $gac-&gt;proxy()-&gt;handlePageview(Request::fromGlobals());\r\n$response-&gt;emit();<\/pre>\r\n\r\n\r\n\r\n<p>The same approach can be used for the tracker script and identify handlers.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Cookie consent and Google Tag Manager<\/h3>\r\n\r\n\r\n\r\n<p>If your website uses a cookie consent banner, you can control when GA Connector starts tracking.<\/p>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<thead>\r\n<tr>\r\n<th>Mode<\/th>\r\n<th>What happens<\/th>\r\n<th>Recommended for<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td><code>auto<\/code><\/td>\r\n<td>Tracking loads when the page opens<\/td>\r\n<td>Websites without a consent banner<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>consent<\/code><\/td>\r\n<td>Tracking waits until you load it<\/td>\r\n<td>Websites using a cookie banner or Google Tag Manager<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>When using <code>consent<\/code> mode, load the tracker after the visitor gives consent:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">$gac-&gt;scriptTag();<\/pre>\r\n\r\n\r\n\r\n<p>The library doesn\u2019t detect consent automatically, so your developer will need to connect this to your existing consent banner or Google Tag Manager setup.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Capture UTM parameters and gclid server-side<\/h3>\r\n\r\n\r\n\r\n<p>You can enable server-side context with:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">'inlineContext' =&gt; true<\/pre>\r\n\r\n\r\n\r\n<p>This allows the server to record information such as:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Landing page URL<\/li>\r\n\r\n\r\n\r\n<li>Referrer<\/li>\r\n\r\n\r\n\r\n<li>Browser information<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<p>This can help preserve attribution information such as UTM parameters and Google Ads click IDs.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\">Important note about caching<\/h4>\r\n\r\n\r\n\r\n<p>Only enable <code>inlineContext<\/code> on pages that aren\u2019t stored in a full-page cache.<\/p>\r\n\r\n\r\n\r\n<p>If the page is cached, visitor-specific information could be included in the cached page.<\/p>\r\n\r\n\r\n\r\n<p>For websites using full-page caching, keep <code>inlineContext<\/code> disabled and load visitor-specific information separately:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:php decode:true\">echo $gac-&gt;settingsScript(); \/\/ safe to cache\r\necho $gac-&gt;contextScript();  \/\/ must not be cached\r\necho $gac-&gt;scriptTag();      \/\/ tracker<\/pre>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Cross-domain tracking<\/h3>\r\n\r\n\r\n\r\n<p>If visitors move between multiple domains you own, add those domains to <code>internalDomains<\/code>.<\/p>\r\n\r\n\r\n\r\n<p>For example, a visitor might move from your main website to a separate booking website.<\/p>\r\n\r\n\r\n\r\n<p>Adding both domains allows GA Connector to keep the visitor\u2019s original lead source as they move between them.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Forms inside iframes<\/h3>\r\n\r\n\r\n\r\n<p>Forms inside iframes work without additional setup.<\/p>\r\n\r\n\r\n\r\n<p>The tracker detects when it\u2019s running inside an iframe and avoids recording the visit twice.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Configuration options<\/h2>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<thead>\r\n<tr>\r\n<th>Setting<\/th>\r\n<th>Required<\/th>\r\n<th>Default<\/th>\r\n<th>Description<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td><code>apiKey<\/code><\/td>\r\n<td>Yes<\/td>\r\n<td>None<\/td>\r\n<td>Your GA Connector API key<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>baseUrl<\/code><\/td>\r\n<td>Yes<\/td>\r\n<td>None<\/td>\r\n<td>Tracking URL on your domain, such as <code>https:\/\/example.com\/gac<\/code><\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>mode<\/code><\/td>\r\n<td>No<\/td>\r\n<td><code>auto<\/code><\/td>\r\n<td>Use <code>auto<\/code> to load immediately or <code>consent<\/code> to wait for consent<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>inlineContext<\/code><\/td>\r\n<td>No<\/td>\r\n<td><code>false<\/code><\/td>\r\n<td>Records landing page, referrer, and browser information on the server. Use only on uncached pages<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>internalDomains<\/code><\/td>\r\n<td>No<\/td>\r\n<td>None<\/td>\r\n<td>Other domains you own that should share attribution information<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>iframeEnabled<\/code><\/td>\r\n<td>No<\/td>\r\n<td><code>true<\/code><\/td>\r\n<td>Shares visitor information between a page and forms inside iframes<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>debug<\/code><\/td>\r\n<td>No<\/td>\r\n<td><code>false<\/code><\/td>\r\n<td>Displays additional information for troubleshooting<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Troubleshooting<\/h2>\r\n\r\n\r\n\r\n<p>If tracking isn\u2019t working as expected, open a tracked page and enter the following in your browser console:<\/p>\r\n\r\n\r\n\r\n<pre class=\"lang:js decode:true\">window.__gacStatus<\/pre>\r\n\r\n\r\n\r\n<figure class=\"wp-block-table\">\r\n<table>\r\n<thead>\r\n<tr>\r\n<th>Status<\/th>\r\n<th>Meaning<\/th>\r\n<\/tr>\r\n<\/thead>\r\n<tbody>\r\n<tr>\r\n<td><code>ok<\/code><\/td>\r\n<td>Tracking is working and the visit was recorded<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>internal<\/code><\/td>\r\n<td>Tracking is working; the visitor came from another page on your website<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>iframe<\/code><\/td>\r\n<td>Tracking is running inside an iframe and avoided recording a duplicate visit<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>awaiting_consent<\/code><\/td>\r\n<td>Tracking is waiting for the visitor to give consent<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>script_pending<\/code><\/td>\r\n<td>The tracker hasn\u2019t loaded. Check whether <code>yoursite.com\/gac\/js<\/code> opens correctly<\/td>\r\n<\/tr>\r\n<tr>\r\n<td><code>conflict<\/code><\/td>\r\n<td>An older GA Connector tracking code is also installed on the page. Remove the old tracking code<\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/figure>\r\n\r\n\r\n\r\n<p>If you\u2019re still having trouble, <a id=\"openSupportBeacon\" href=\"#\">contact GA Connector support<\/a> and include the status shown in the console.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">How do I track UTM parameters on a PHP website?<\/h3>\r\n\r\n\r\n\r\n<p>Install the GA Connector PHP library with Composer, add the tracking code to your main page template, and create a <code>\/gac\/<\/code> route on your website.<\/p>\r\n\r\n\r\n\r\n<p>GA Connector can then capture UTM source, medium, and campaign information and connect it to leads in your CRM.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Can I use GA Connector without WordPress?<\/h3>\r\n\r\n\r\n\r\n<p>Yes. If your website runs on PHP, you can use the server-side tracking library instead of the WordPress plugin.<\/p>\r\n\r\n\r\n\r\n<p>It works with the same GA Connector account, CRM integrations, and reports.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Does server-side tracking work with ad blockers?<\/h3>\r\n\r\n\r\n\r\n<p>Because tracking requests go through your own domain instead of directly to a known third-party tracking domain, they\u2019re less likely to be blocked.<\/p>\r\n\r\n\r\n\r\n<p>However, no tracking method can guarantee that every visit will be captured.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Does it work with Laravel and Symfony?<\/h3>\r\n\r\n\r\n\r\n<p>Yes. The library works with PHP 7.4+ websites, including Laravel, Symfony, CodeIgniter, and custom PHP applications.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Does it work without JavaScript?<\/h3>\r\n\r\n\r\n\r\n<p>A small tracking script still runs in the visitor\u2019s browser, but it loads through your own domain and sends the data through your server.<\/p>\r\n\r\n\r\n\r\n<p>Server-side context can also capture information such as the landing page URL on the server.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Is my GA Connector API key exposed?<\/h3>\r\n\r\n\r\n\r\n<p>No. Your server adds the API key when it forwards tracking data to GA Connector, so the key isn\u2019t included in your public website code.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">Does it support cookie consent?<\/h3>\r\n\r\n\r\n\r\n<p>Yes, but you need to connect it to your existing consent setup.<\/p>\r\n\r\n\r\n\r\n<p>Use <code>consent<\/code> mode and load the tracker after the visitor accepts tracking through your cookie banner or Google Tag Manager.<\/p>\r\n\r\n\r\n\r\n<h3 class=\"wp-block-heading\">How much does it cost?<\/h3>\r\n\r\n\r\n\r\n<p>The PHP library is free and open source under the MIT licence.<\/p>\r\n\r\n\r\n\r\n<p>You still need an active GA Connector subscription to send attribution data to your CRM.<\/p>\r\n\r\n\r\n\r\n<h2 class=\"wp-block-heading\">Resources<\/h2>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li><a href=\"https:\/\/packagist.org\/packages\/gaconnector\/server-side-tracking\">Server-side tracking library on Packagist<\/a><\/li>\r\n\r\n\r\n\r\n<li><a href=\"https:\/\/github.com\/ga-connector\/php-server-side-tracking\">Source code and developer documentation on GitHub<\/a><\/li>\r\n\r\n\r\n\r\n<li><a href=\"https:\/\/github.com\/ga-connector\/php-server-side-tracking\/blob\/HEAD\/examples\/website\/\">Example website setup<\/a><\/li>\r\n\r\n\r\n\r\n<li>Need help with setup? <a id=\"openSupportBeacon\" href=\"#\" role=\"button\">Contact GA Connector support<\/a>.<\/li>\r\n<\/ul>\r\n","protected":false},"excerpt":{"rendered":"<p>If your website runs on PHP and you\u2019re not using WordPress, you can use GA Connector\u2019s server-side tracking library to capture where your leads came from and send that information to your CRM. It captures attribution data such as UTM parameters, Google Ads click IDs (gclid), landing pages, and referrers. The library works with Laravel, [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/3904"}],"collection":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/comments?post=3904"}],"version-history":[{"count":22,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/3904\/revisions"}],"predecessor-version":[{"id":3926,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/3904\/revisions\/3926"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=3904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=3904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=3904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}