Integrating Marketo and Google Analytics - Question
Hello,
I have completed the steps outlined in this tutorial with about 95% success. Here is what I've been able to do:
- Modify my form embed code to track events with Google Tag Manager
- Modify my form embed code to push the Google Analytics Client ID back to a hidden field on the form.
- Create a web hook to send the Marketo Unique User ID to Google Analytics via a new event that's performed from the web hook.
Where I'm stuck - I want the Marketo Unique User ID to show up on the user explorer as an additional custom dimension that I've labeled as UserId (I know they are different, but I'm rolling with it for now). I have the custom dimension set to user so it's visible on the user explorer section within GA, but it's listed as (not set). I've verified that the web hook is pushing this data and populating the custom dimension because when I look at it from an event perspective it's there. When I try to view the data from the user's perspective it's not set with the event logged. What am I missing to tie that unique id to the user in Google Analytics?
My form embed code:
<script src="//app-ab16.marketo.com/js/forms2/js/forms2.min.js"></script>
<form id="mktoForm_2021"></form>
<script>MktoForms2.loadForm("//app-ab16.marketo.com", "889-DKW-954", 2021,
function(form){
form.onSuccess(function(values, followUpUrl){
dataLayer.push({event:'mktoLead',mktoFormId:
form.getId()});
// rest of your success handler...
return true;
});
// Set the value of the GA client id
function getgacid() {
try {
var tracker = ga.getAll()[0];
return tracker.get('clientId');
} catch (e) {
return 'n/a';
}
}
form.vals({
'gacid': getgacid()
});
});
</script>
My webhook info:
https://www.google-analytics.com/collect?v=1&t=event&tid=UA-65670986-7&cid={{lead.ga.cid:default=edit me}}&ec=marketo&ea=webhook&el={{Lead.Marketo Unique Code}}&cd3={{Lead.Marketo Unique Code}}
I just made my test page a password protected page so that should protect normal users from finding it while still giving all of you access to help me. The url is https://www.arvigbusiness.com/katies-form-test-page/ password is test.