Google Ad attribution via Forms API submissions

Hi,

We have an existing HS landing page with an embedded form which is properly set up as Google Ads target. When leads submit their information via the HS form, the HS contact has proper Google Ad attribution.

We are trying to trigger the submission of this form via the Forms API (per https://legacydocs.hubspot.com/docs/methods/forms/forms_overview and https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication) to accomplish the same result, but from an application/form outside of HS.

It is unclear based on the documentation and my search in the forums where we can provide the various Google Ad specific query params (url) within the POST body call to https://api.hsforms.com/submissions/v3/integration/secure/submit/:portalId/:formGuid.

For reference, the Google Ad query params would include:

- utm_source

- utm_medium

- utm_campaign

- utm_term

- hsa_mt

- hsa_net

and others.

Thanks!

Hi @VGlava ,

Great question, I found this post that indicates that you can pass the UTM params through the context object in your API call:

const formData = {
 context: {
 pageUri: 'https://examplepage.com?utm_campaign=my_campaign&utm_source=facebook&utm_medium=test',
 },
};

I haven’t tested it, but it might be worth a shot.