Checking for Existing Query String

jonlcrow
Member

I am working with Google Analytics to track form submissions. I want to be able to track the lead by a specific campaign but use the same (Pardot) form whether the user came in through PPC, and email campaign, or organic search.

 

If the user comes in through email or PPC there will be an attached query string that passes the UTM parameters to the form. However, if they come in through an organic search I would have to add the UTM parameters I want within a query string of the post URL. But if I add the query string I am afraid of overwriting any values that get passed via a query string coming in from email or PPC.

 

Is this going to be a problem? If so is there a way to check and see if there is a query string and if not append the UTM parameters?

 

Thanks,

Jonathan

3 Replies 3
edjusten
HubSpot Employee

Hi @jonlcrow Apologies no one has responded yet.   Can you provide a bit more context here? Are you concerned about how the query strings will affect a contact's original source? or are you using the query strings to populate hidden form fields? Finally, what specific end result are you looking for?

 

Thank you,

Ed Justen 


Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
jonlcrow
Member

Yes. I am using UTM parameters and Query Strings to add data to a form submission, in hidden fields and through Google Analytics.

 

If a lead comes in through a PPC or email campaign they will already have a query string. If not I want to add a query string with the appropriate UTM parameters and hidden field data. I found a way to use javascript to see if there is a query string, and if not append one and pass the data through. It seems to be working but we ran into other issues before I know for sure.

 

Thanks for the follow-up.

 

Cheers,

Jonathan

0 Upvotes
jvniekerk
Member

Hi

Did you get an answer to this question?

I have a similar issue. We are adding the UTM parameters from Google Analytics for PPC campaigns, but HubSpot then removes these from the URL before the customer lands on our website, so we can't keep track of it on our own database.

@HubSpot := Is there a way to get around this, or to access the UTM parametrs when the customer lands on our website?

Thanks

0 Upvotes