I wanted to share a step-by-step on our solution to track multiple landing pages with a Person Attribute Field while using one generic form, without relying on URL UTM parameter. I hope this will be helpful to anyone looking for a solution. This solution was pieced together through some research from different sources and some trial and error. Feel free to share your thoughts or comments on it! Let's begin.
We have multiple landing pages linked to different campaigns and different assets to download. We wanted to use one generic form for all of those landing pages, and capture a Person Attribute Field to track the campaign, we didn't want long UTM parameters following our URLs or multiple forms so we built it into the page instead.
Populate a Hidden Field on your form through HTML code embedded into your Landing Page to capture campaign information.
An alternate solution which doesn't use Person Attribute fields – you can also use the "Add Constraint" option on the Fills Out Form trigger to select any form and the web pages you want to capture for the campaign, as shown below. If that's all you need, this simple solution would suffice.
In your generic form, add a new Field and select the Person Attribute you're going to use to track the landing page. For our form, I used the "utm_campaign" Person Attribute because we're already tracking through that field. You can choose to use any Person Attribute that is appropriate for your Marketo instance to track campaigns. The Label doesn't matter, set Field Type to "Hidden", and set Form Pre-fill to "Disabled".
Edit the Autofill, set Default Value as "utm tracking missing" (or anything similar of your choice, we'll get into why later) and Get Value from as "Use Default Value". If you don't set a default value Marketo defaults to "null" which will block changes to that field for this form.
Once you're happy with your other fields, save your form.
In your Design Studio, find the Landing Page Template you're using for your Landing Pages, and edit it. Note this step is only for Marketo Guided Landing Pages*.
In your head section, place the following Marketo String with your meta tags (more information on Marketo Strings here). This will allow you to easily adjust the landing page campaign later as you create more pages.
Find where your Marketo form div is located, and insert the script code following the mktoForm div as shown below. This script will change your hidden "utm_campaign" field to the value indicated on your landing page.
"utmcampaign"** is your Person Attribute Field name, and ${hiddencampaign} points to the Marketo String you set up. Save your Landing Page Template and you are done with this step.
*Note: You can also do this step with embedded forms on non-Marketo pages using the code for setting Hidden Fields on this page. Note that you'll skip setting the Marketo String Syntax and input your desired Person Attribute value directly into the script as Marketo Syntaxes cannot be used on non-Marketo pages.
**Note: You'll notice that the HTML form.vals "utmcampaign" is different from the displayed Person Attribute "utm_campaign" in your form editor and Marketo record. Sometimes the actual SOAP API value used by the backend is different from the Friendly Display value in Marketo, I will include steps on how to check the SOAP API value in the appendix at the end of this tutorial.
Once your HTML is set in your Landing Page Template, create or edit your Landing Page using that template.
Set your generic form from earlier, and in your right-hand elements bar you should see a section for Variables, where you'll see the "Hidden Campaign Field" you created using the mktoString meta tag. Type in the campaign name you want to track with there. I chose "Example Campaign" for the purpose of this tutorial.
Once you're happy with the rest of your landing page go ahead and save it. Your landing page form will now populate the "utm_campaign" Person Attribute for the Person with "Example Campaign" once the form is submitted.
Now that all the client facing elements are ready, you can create your Trigger Smart Campaign to capture and update the Person record.
In your Marketo Program, create a new Smart Campaign. I've named mine "Campaign Capture" for my own organization, but you can name it whatever you want. Description is up to you, or just leave it blank.
Once it's created, go to the Campaign's Smart List and add the Trigger Filter "Fills Out Form", and indicate one or more forms that feed into this campaign. Now add a Filter for "utm_campaign" and set the value to the "Hidden Campaign Field" you indicated on your landing page, in this case "Example Campaign".
Insert any other Filters you want to exclude or include People that come through the program, and make sure to adjust your Smart List Rule Logic accordingly. Once you're happy with it, move onto the Flow step and set your form fill success actions. For this tutorial, we've opted to "Change Program Status" to Responded and "Send Email" confirming form success. Now "Activate" your Trigger Smart Campaign and you're ready to go!
No process is without errors, so now we'll set up a simple error reporting Trigger Smart Campaign to notify you when your campaign capture process fails at the form step. You'll recall that in the form, we set the Default Value for our "utm_campaign" as "utm tracking missing". This is so that in the event the HTML code in your Landing Page fails to populate the field with a value, the form sets this as the "utm_campaign" Person Attribute.
To catch this error and notify myself, I set up a new Default Program with our "Operational" channel settings and named it "Tracking Error Notification". Inside it I created Smart Campaign and and an Alert Email (information on creating Alert Emails using the specific Alert Token).
In the Smart Campaign Smart List, insert a Trigger Filter for "Data Value Changes", Add Constraint "New Value" set it as the default error value, in this case "utm tracking missing"
Now all that's left is to create a Flow Step to "Send Alert" (information on how here). Now you'll receive an email alert anytime the utm_campaign field fails to populate through the Landing Page form.
*EDIT: A commenter recommended that the error message be cleared so that multiple exceptions can be flagged, which would be a great step. To do so, add a "Change Data Value" flow step for the Person Attribute, in this case "utm_campaign" and set the new value to "NULL", which will clear the "utm_campaign" field after the alert is sent.
You're done!
Now for all future Landing Pages with this generic Form, just remember to populate the "Hidden Campaign Field". I hope you've found this tutorial helpful.
Cheers,
Marketing Operations
TigerText
So you've set your hidden Person Attribute field and indicated it in your HTML code, but the Person Attribute is still not populating correctly through the form. The issue may be that the Friendly Display Person Attribute field name is different from the SOAP API Person Attribute field for HTML. If you don't have Marketo Admin access, or don't feel like exporting the full field list, here's how you can check it:
Publish or preview your Landing Page and go to it in your browser. Right-click at the bottom of the form (on Chrome) and hit Inspect. This will pull up the righthand side development panel to show you the HTML.
Find the where the Marketo Form HTML is located and expand the mktoFormRow where the hidden field is. In the highlighted section below, you'll see that the SOAP API name of the Person Attribute is "utmcampaign" and not "utm_campaign". Simply drop this correct SOAP API Person Attribute name into your code back in Step 2.