aliId | Requirements to include the aliId in the thankYouURL | Community
Skip to main content
Level 4
July 3, 2024
Solved

aliId | Requirements to include the aliId in the thankYouURL

  • July 3, 2024
  • 3 replies
  • 3383 views
Hi everyone,

As far as I know, there should be a URL parameter included in our thankYouURL. I have seen this URL parameter appear in our thankYouURL from time to time, but it does not always show up.

Are there any specific requirements that need to be fulfilled for an aliId to be added to the thankYouURL? For example:

  • Does the form need to be on a Marketo landing page?
  • Does the form need to be on an external landing page?
  • Will the aliId only appear if there is no _mkto_trk cookie present?
  • Does the ThankYouPage URL need to be on an external page?
  • Etc.

Do you know more about this?

In the end, I want to extract the aliId from the ThankYouPageURL using JavaScript. However, when I try to do it as shown below, the URL usually does not contain any URL parameters.

Thanks and kind regards
Wolfram

 

form.onSuccess(function(values, followUpUrl) { console.log(followUpUrl); return false; });

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

The aliId should be added to the Thank You URL in all cases other than the following:

  • the form’s defined Thank You setting is External URL and
  • the URL’s hostname part is not a Marketo LP Domain or Domain Alias for the instance and 
  • the form is either
    • a named form on a Marketo LP using the form-defined Thank You or
    • an embedded form on a non-Marketo site (which always uses the form-defined Thank You)

 

In all other cases you should expect the aliId, for example:

  • if the form-defined Thank You is a Marketo LP chosen from the LP browser and the form is embedded on a non-Marketo site: expect aliId
  • if the form-defined Thank You is an External URL, the URL’s hostname is one of your LP domains, and the form is embedded on a non-Marketo site: expect aliId
  • if the form-defined Thank You is External URL = https://www.example.com (that literal URL, not a placeholder) and the form is placed on a Marketo LP, but the Thank You is overridden at the LP level External URL = https://www.example.com (e.g. same exact URL but set at the LP level): expect aliId

3 replies

Jasbirka
Level 5
July 4, 2024

⚠️ This post has been edited by a moderator.
It contains numerous falsehoods which may be AI-generated hallucinations.

Hi @wolframclotz 

 

The aliId (Alias ID) parameter in Marketo thank you URLs is related to the tracking and association of form submissions with specific campaigns or assets. To ensure the aliId appears consistently, certain conditions should be met. Here are some key points to consider:

  1. Form on a Marketo Landing Page: When a form is embedded on a Marketo landing page, the aliId should be automatically included in the thank you URL. This is because Marketo has full control over its own landing pages and can ensure proper tracking.
  2. Form on an External Landing Page: When a form is embedded on an external page, the aliId parameter may not always be included in the thank you URL. This can be due to differences in how external pages handle Marketo forms and tracking scripts.
  3. Presence of _mkto_trk Cookie: The _mkto_trk cookie is used by Marketo to track visitor sessions. If this cookie is not present or is blocked, it might impact the generation of the aliId in the thank you URL. However, the absence of this cookie typically affects tracking more than the inclusion of the aliId.
  4. Thank You Page URL: Whether the thank you page URL is on a Marketo landing page or an external page can influence the presence of the aliId. Consistency is more likely when the thank you page is within the Marketo environment.

To extract the aliId from the thank you URL using JavaScript, ensure the form submission process includes the aliId parameter. Here's a basic example of how to extract it:

 

// Function to get URL parameter by name function getParameterByName(name, url) { if (!url) url = window.location.href; name = name.replace(/[\[\]]/g, '\\$&'); var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url); if (!results) return null; if (!results[2]) return ''; return decodeURIComponent(results[2].replace(/\+/g, ' ')); } // Get the aliId parameter from the current URL var aliId = getParameterByName('aliId'); console.log('aliId:', aliId);

 

 

To improve the consistency of the aliId parameter appearing in the thank you URL:

  • Ensure that the form and thank you page are both on Marketo-hosted pages.
  • Verify that the Marketo Munchkin tracking script is properly installed and functioning on all relevant pages.
  • Test different configurations and monitor the thank you URL to identify any patterns or issues that affect the aliId parameter's presence.

If the aliId parameter still doesn't appear consistently, you might need to review your form settings and tracking scripts, or consult Marketo support for further assistance.

 

Thanks!

Jasbir

 

SanfordWhiteman
Level 10
July 4, 2024

@jasbirka about half of what you wrote is false. The response appears AI-generated and will be deleted.

 

Please supply only accurate, tested information on the Community. (This should be self-evident.)

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
July 4, 2024

The aliId should be added to the Thank You URL in all cases other than the following:

  • the form’s defined Thank You setting is External URL and
  • the URL’s hostname part is not a Marketo LP Domain or Domain Alias for the instance and 
  • the form is either
    • a named form on a Marketo LP using the form-defined Thank You or
    • an embedded form on a non-Marketo site (which always uses the form-defined Thank You)

 

In all other cases you should expect the aliId, for example:

  • if the form-defined Thank You is a Marketo LP chosen from the LP browser and the form is embedded on a non-Marketo site: expect aliId
  • if the form-defined Thank You is an External URL, the URL’s hostname is one of your LP domains, and the form is embedded on a non-Marketo site: expect aliId
  • if the form-defined Thank You is External URL = https://www.example.com (that literal URL, not a placeholder) and the form is placed on a Marketo LP, but the Thank You is overridden at the LP level External URL = https://www.example.com (e.g. same exact URL but set at the LP level): expect aliId
SanfordWhiteman
Level 10
July 4, 2024

In the end, I want to extract the aliId from the ThankYouPageURL using JavaScript.

Extract and do what with it?

Level 4
July 4, 2024

Great, thank you! This is really helpful. I have the impression that in some of my test cases, where I missed the aliId, I should have received one. But I'll dive deeper into this.

In some cases, we use custom code to set the follow-up URL differently from the form configuration. Until now, we haven't missed or considered the aliId during this process. However, for the future, I would like to incorporate this aspect into our code. I just wondered, as in several cases I didn't get any aliId. 

From what I understand, the aliId ensures that information from one form submission is instantly available on the follow-up page, right? I think this is pretty useful in some cases.

Another interesting aspect would be whether the aliId serves as a lead identifier, similar to the munchkin cookie and the mkt_tok.

Would it be possible to use it in combination with DTP pages?

I'm thinking of scenarios where the lead submitted a form on a non-Marketo LP, where no mkt_tok is available, and the munchkin cookie can't be used. Currently, our DTPs work with the munchkin cookie to identify the lead, but in some scenarios, the cookie isn't available. 
Did you test this already? 

SanfordWhiteman
Level 10
July 5, 2024

From what I understand, the aliId ensures that information from one form submission is instantly available on the follow-up page, right? I think this is pretty useful in some cases.


Yes, only the fields from the submission itself. Of course that same data is available in the onSuccess and could be forwarded in the query string, i.e. as Base64-encoded JSON.

 


Another interesting aspect would be whether the aliId serves as a lead identifier, similar to the munchkin cookie and the mkt_tok.

Would it be possible to use it in combination with DTP pages?


SimpleDTO already attaches the current URL’s query string to the hidden DTP’s query string, so the aliId is already covered.