APIs & Integrations

samtherobot
Member

onFormSubmit tracking not matching actual form submissions

SOLVE

Hi there,

 

We are currently running an ad campaign and trying to track submissions for that ad campaign with third party tools (Facebook, DoubleClick).

 

I added the tracking code into the onFormSubmit callback function so that it should fire and send data to the tracking tools.

 

However, when I look in the analytics of the tools (Facebook specifically), I see far more conversions than I do actual form submissions. I see 21 conversions in Facebook but in HubSpot I only see 3 form submissions attached to 3 contacts.

 

Anyone have any ideas what would be happening and how I can possibly troubleshoot it?

 

Thanks

0 Upvotes
1 Accepted solution
samtherobot
Solution
Member

onFormSubmit tracking not matching actual form submissions

SOLVE

I think I found the issue. Thank you to Wendy for just asking the right questions.

 

I realized the following code I got from our advertiser wipes out the entire page using document.write. 

 

document.write('<img src="removedurl" width=1 height=1 border=0>');
 
I have replaced the code with the following:
 
var myImage = new Image(1, 1);
myImage.src = 'removedurl';
document.body.appendChild(myImage);
 
Thanks

View solution in original post

0 Upvotes
3 Replies 3
WendyGoh
HubSpot Employee
HubSpot Employee

onFormSubmit tracking not matching actual form submissions

SOLVE

Hi @samtherobot,

 

To get a full picture of things here, could you clarify the following:

1. Does the 21 converted leads in Facebook includes the 3 contacts who submitted the HubSpot form?

2. What's the page that contain the form? 

3. How are you add FB tracking code into the onFormSubmit callback?

4. Can you try doing one form submit and see if it's being tracked in Facebook?

0 Upvotes
samtherobot
Member

onFormSubmit tracking not matching actual form submissions

SOLVE

Hi Wendy,

 

Here are the answers to your questions:

  1. I can't actually tell since Facebook analytics doesn't allow you to get granular and identify individuals. I was assuming they were but I have no way to confirm that at this point.
  2. https://www.shilohuniversity.edu/getequipped/
  3. I'm using the following code:
fbq('track', 'Lead', {
                    content_category: hsForm.find('[name="degree_level"]').val(),
                    content_name: hsForm.find('[name="degree_program"]').val(),
                });
 
This tracks the degree level and degree program they are checking. Again, with Facebook I can't track things like email as that is personally identifiable and would violate Facebook's policy.
 
4. So I just tried this (which I had test earlier and it worked), when I submit the form I get a white screen. I don't see any errors in the console though so I can't tell what went wrong...ugh.
 
 
0 Upvotes
samtherobot
Solution
Member

onFormSubmit tracking not matching actual form submissions

SOLVE

I think I found the issue. Thank you to Wendy for just asking the right questions.

 

I realized the following code I got from our advertiser wipes out the entire page using document.write. 

 

document.write('<img src="removedurl" width=1 height=1 border=0>');
 
I have replaced the code with the following:
 
var myImage = new Image(1, 1);
myImage.src = 'removedurl';
document.body.appendChild(myImage);
 
Thanks
0 Upvotes