-
Notifications
You must be signed in to change notification settings - Fork 139
[STRATCONN-354] Marketo-V2 associateLead() deprecation #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
integrations/marketo-v2/lib/index.js
Outdated
| */ | ||
|
|
||
| Marketo.prototype.initialize = function() { | ||
| var self = this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need to reassign this to self here. When passed as an argument to a method (as on line 108), this should still refer to the outer context (in this case, the initialize prototype method).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that only apply if you are trying to access this itself inside of the function? All I'm doing on 108 is to pass a reference to the value inside the options object. Options become available via the scope of the function (this).
I'll move the reasign below the variable definitions but please let me know what you think.
| .option('host', 'https://api.segment.io') | ||
| .option('accountId', '') | ||
| .option('projectId', '') | ||
| .option('traits', []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add the marketoFormId option somewhere here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I'm not sure but I will learn about this. There's also marketoHostURL and it should be added in here as well
integrations/marketo-v2/lib/index.js
Outdated
| var url = require('component-url'); | ||
| var when = require('do-when'); | ||
| var each = require('@ndhoule/each'); | ||
| var onBody = require('on-body-ready'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we simply write our own helper method rather than install a third-party package. The relevant code looks to be about ~10 lines or so. Can we copy/paste?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea! I was just following a pattern I saw in another integration but I'd rather not use a dependency. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out load will be enough to make sure the form library is ready to work! we don't need to bring anything in 😎
integrations/marketo-v2/lib/index.js
Outdated
| }; | ||
|
|
||
| Marketo.prototype.setupAndSubmitForm = function(traits, form) { | ||
| console.log('PRIME') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to keep this console.log ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No no, this was for testing purposes. My bad!
| }); | ||
|
|
||
| this.load('forms', { marketoHostUrl: marketoHostUrl }, function() { | ||
| var marketoForm = document.createElement('form'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we only create the form id marketoHostUrl is defined ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a validation for that already. The code won't reach this point if marketoHostUrl is undefined
| "@segment/analytics.js-integration-gtag": "file:../integrations/gtag", | ||
| "@segment/analytics.js-integration-gosquared": "file:../integrations/gosquared", | ||
| "@segment/analytics.js-integration-heap": "file:../integrations/heap", | ||
| "@segment/analytics.js-integration-hellobar": "file:../integrations/hellobar", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These deletes seem unrelated to your changes, do we need them in this PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it's cleanup work but I think we should keep them. Otherwise, people will always have to troubleshoot the compiler before being able to start working.
1b66d5e to
4542428
Compare
|
@marinhero Is it possible to share, either directly in the PR comment or in a linked paper doc, the manual testing you did using the compiler tool? |
integrations/marketo-v2/lib/index.js
Outdated
| Marketo.prototype.setupAndSubmitForm = function(traits, form) { | ||
| form.addHiddenFields(traits, form); | ||
| // Do not remove this callback. This ensures there are no page refreshes after the form is submitted. | ||
| form.onSuccess(function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an onFailure callback to not refresh in that scenario either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No callback available https://developers.marketo.com/javascript-api/forms/api-reference/ :|
lcampos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved pending the couple of changes we talked about earlier
a0bb739 to
62c770c
Compare
25b973e to
630b43c
Compare
630b43c to
c62b13e
Compare
What does this PR do?
Deprecates the Marketo
associateLeadand uses the recommended method ofMktoForms2instead.Are there breaking changes in this PR?
Marketo will be removing
associateLeadin October. If customers don't take preemptive actions to start using forms, their calls to identify will be showing a message in the console:'Invalid settings for identify method. Please review your Marketo V2 destination settings.'
Customer comms and doc updates are in progress to mitigate the hard cutover.
Testing
Does this require a new integration setting? If so, please explain how the new setting works
Yes, two:
Both settings are strings, available via CDN, and not required since track can work without them.
Links to helpful docs and other external resources