Lead Capture Tools

Im1
Member

How to collect an interest/source data

Hello there,

 

I have 6 different landing pages (each one for a different subject)

and i want to collect an interest/source data to each lead registration so that i will know from which landing source the lead is generated from

 

so far im using the same lead registration form in all of the landing pages and managed to collect "name" and "phone number" fields successfully.

 

how can i create such function within Hubspot?

 

 

 

0 Upvotes
2 Replies 2
Phil_Vallender
Most Valuable Member | Diamond Partner
Most Valuable Member | Diamond Partner

How to collect an interest/source data

Hi @Im1 

 

Each contact in HubSpot has a First Conversion property that contains the page and form that they first converted on - so this can be used to identify interest. 

 

If you want to store this in a property, and not have it overwritten each time a new form is submitted, you will need to use a HubSpot workflow to set the value of a custom property based on the title of the page on which they converted. 

 

Hope this helps.

Phil Vallender | HubSpot Website Agency
Im1
Member

How to collect an interest/source data

Hi @Phil_Vallender 

 

Thanks for the reply!

 

I understand that the property is called "First referring site" or "hs_analytics_first_referrer" (in its internal name) do you know how i can apply this property within my registration form so it can be viewed inside the contact info?

 

*(I also dont have Hubspot premium so i can not access HubSpot workflow)

 

This is how my registration.php look like so far :

<?php


$baseUrl = 'https://api.hubapi.com/contacts/v1/contact?hapikey=';
$token = '*****************************************';

$postData = array(
    'properties' => array(
        array(
            'property' => 'firstname',
            'value' => $_POST["name"]
        ),
        array(
            'property' => 'phone',
            'value' => $_POST["phone"]
        )
    )
);


$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $baseUrl . $token);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
$post= str_replace(" ","+",json_encode($postData,JSON_UNESCAPED_UNICODE));
curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Content-Type: application/json"
));

$response = json_decode(curl_exec($ch));
curl_close($ch);
this is the two inputs within my form HTML to collect phone and name:
<input type="text" class="text-field w-input" maxlength="256" name="name" data-name="Name" placeholder="Vor- und Zuname" id="name">

<input type="text" class="text-field-2 top-input w-input" maxlength="256" name="phone" data-name="Phone 2" placeholder="Tel. Nr." id="phone-2" required="">
 
 
0 Upvotes