Adluge tracking
===========
We can access the form submission values using webhooks provided by gravity forms. For this we need to call the gform_after_submission function to functions.php file of your theme.
add_action(“gform_after_submission”, “after_submission”, 10, 2);
Then declare after_submission just below of that. We need to pass the $entry and $form variables along with a function to access form submission contents.
function after_submission($entry, $form){
// declare the tracking code here.
}
If the site uses multiple forms we can access each of them separately using form id.
if($entry[‘form_id’]==4)
{
// declare the tracking code here.
}
And
if($entry[‘form_id’]==1)
{
// declare the tracking code here.
}
Then set each field value to a variable to send to Adluge, like below…
if($entry[‘form_id’]==4)
{
$fname = $_REQUEST[‘input_1’];
$postal_code = $_REQUEST[‘input_6’];
$phone = $_REQUEST[‘input_2’];
$email = $_REQUEST[‘input_3’];
$other_fields = array(‘Form Name’=>$frm_name,”Postal code”=>$postal_code);
// all other fields you need to track on Adluge
}
Then include ‘clientcenter-api-library.php’ file and pass all the required values to adluge , just like code provided below.
if($fname!= “”)
{
require_once(“clientcenter-api-library.php”);
$lead = new clientcenter();
$lead->client_code=”8aa2a469217d7d6cf4ab9f20681a7f7e”;
// Mandatory. Unique identification code.
$lead->fname=$fname; //post Value of first name
$lead->lname=$lname; //post Value of last name
$lead->phone=$phone;//post Value of Phone Number
$lead->email=$email;//post Value of Email addess
// $lead->address=$address;
$lead->city=$city;
$lead->other_fields=json_encode($other_fields);//post Value of other_fields
$lead->comments=nl2br($comments);//post Value of Comments
$lead->status=1; // No need to change this
$lead->gclid=$_COOKIE[‘gclid’];
//No need to modify any of the below code
$lead->useragent = $_SERVER[‘HTTP_USER_AGENT’]; //browser properties
$lead->remote_ip=$_SERVER[‘REMOTE_ADDR’]; //ip address
$lead->referrer=$_SERVER[‘HTTP_REFERER’];// page source
$lead->contact_date=date(“Y-m-d h:i:s”);
$lead->search_engine=$_COOKIE[‘adl_durl’];
$lead->keyword=$_COOKIE[‘adl_key’];
$lead->source=$_COOKIE[‘adl_camp’];
$lead->randomnum=$_COOKIE[‘adl_rand’];
$lead->adl_ref=$_COOKIE[‘adl_ref’];
$lead->send_to_adluge=true;
// Set to true If you are sending leads to adluge
//default true
$lead->send();
}
Here is the complete example code of adluge tracking using gravity forms.




You can access the reference file here :
https://drive.google.com/file/d/1rSw-sX5kjWUz_3JMzNYhTPNjzeE3SWNA/view?usp=sharing
Other Reference docs.
GoogleGCLID AdLuge Tracking Click Identifier (GCLID): Definition
Google Click ID (GCLID) is a parameter passed in the URL with ad clicks, to identify the campaign and other attributes of the click associated with the ad for ad tracking and campaign attribution. In Google Ads, this is enabled by turning on the auto-tagging setting. It’s required for Google Ads website conversion tracking and also used to link data between Google Ads and Google Analytics. It can also be used in conjunction with features like offline conversion tracking.