SlideShare a Scribd company logo
1
Michael Freeman – Director, Demand Generation & Marketing Operations
San Francisco/Silicon Valley Eloqua User Group – March 23, 2016
Modern Goal Tracking Strategies & Analytics
2Michael Freeman, @spanishgringo
WARNING - High Density Deck
There's lots of text & few images
3Michael Freeman, @spanishgringo
 We tend to improve what we measure
 Good decisions are very hard without good data
 Yet, good measurement practices are very rare
Good measurement is the foundation of DG
4Michael Freeman, @spanishgringo
 Not enough investment in understanding the data or
what’s important to the business
 Choose a path of least resistance for data gathering
 We don’t think about the future
Why don’t most marketers measure well?
5Michael Freeman, @spanishgringo
OK, but what about goal tracking?
6Michael Freeman, @spanishgringo
 Not enough investment in understanding the data or
what’s important to the business
– We setup the wrong goals to track
 Choose a path of least resistance for data gathering
– Data quality suffers & maintenance eats a lot of time
 We don’t think about the future
– A limited view of the data & can’t handle change well
Goal tracking suffers as a result
7Michael Freeman, @spanishgringo
Thank you page-based
Pros
 Quick to start using
 Seemingly easy
 Low technical knowledge needed
Cons
 Not scalable or very flexible
 SEO/WEB needs != Data needs
 Lots of maintenance
Form submission-based
Pros
 Flexibility by using virtual URLs
 Very rich data gathering
 Separate tracking from UX & SEO
 Low maintenance
Cons
 Requires some up-front planning
 Higher technical requirements
Goal tracking – a tale of two methods
8Michael Freeman, @spanishgringo
1. Create a common goal tracking function (GTF)
– Define the variables to pass to the GTF
• What? = Conversion Type
• Where? = Location
• So What? = Goal Value
– Hook in your various goal tracking services
– Host it in a common location such as Google Tag Manager
2. Form preparation
– Determine how you’ll pass the variables to the GTF
– Setup a global form listener for onSubmit events
3. Configure goals in your analytics services, as necessary
Setting up the form submission method
9Michael Freeman, @spanishgringo
 conversionType (required): This will tell us where to bucket the conversion in our tracking systems.
– I recommend using a number followed by a forward slash and description of the conversion in short, URL-style text.
– 2/online-demo, 1/contact-us, 3/asset-download, 1/free-trial
 trackPath (optional): The location of the form completion. In almost all circumstances it will be defined by the value of
window.location.pathname
 goalValue (optional): This value captures the $-value we associate with a goal completion. In most cases this will be a
static value associated with the conversionType and is typically used dynamically only in ecommerce situations
trackPath + "/form/" + conversionType
"/products/adaptive-suite" + "/form/" + "2/online-demo"
/products/adaptive-suite/form/2/online-demo
The what, where, & how much of tracking
10Michael Freeman, @spanishgringo
 goalCompletion: the namespaced object to handle all logic
 bindFormSubmit: sets the event listener for onSubmit and calls trackGoal
 trackGoal: fires off all of the individual tracking functions for each service
 trackGoal_ga: fires off the call to GA
 trackGoal_optimizely: fires off the call to Optimizely
 trackGoal_bing: fires off the call to Bing Ad Center
 Etc.
Anatomy of goalCompletion {}
11Michael Freeman, @spanishgringo
Load goalCompletion from GTM
<script type="text/javascript">
try {
if (typeof goalCompletion === "undefined") {
$.ajax({
url: "//yourwebsite.com/assets/js/goalCompletion.js",
dataType: "script",
cache: !0
}).done(function(){
//look for any eloqua forms and bind the submit handler
if ($('#eloquaForm').length > 0) {
//insert code here to set the conversion variables
goalCompletion.bindFormSubmit(typeof conversionType == 'undefined' ? undefined : conversionType, typeof
trackPath == 'undefined' ? undefined : trackPath, typeof goalValue == 'undefined' ? undefined : goalValue);
}
});
}
} catch (error) {}
</script>
Google Tag Manager is a great way to include this script loader on all of your pages
12Michael Freeman, @spanishgringo
Adding form-based goal tracking to GA
• Make sure you choose
regular expression
• Use the same pattern to
define form viewing for
better funnel reports
13Michael Freeman, @spanishgringo
 Form has default hidden field
called conversionType
 The form load handler reads the
conversionType field value and
sets the form submit handler
variables
 On form submission (passing
html5 validation) the trackGoal
function is called
 All tracking services are updated
Putting it all together
14Michael Freeman, @spanishgringo
 We can track goal completions
anywhere on the site
 We can see where the form is
most likely to be completed
 We can create a separate set of
goals to track Tier-2 goals
 It's easy to update and maintain
since it's tied to the form code,
not the destination URL
Putting it all together - continued
15Michael Freeman, @spanishgringo
 Take the time to think about your reporting comprehensively
 Use goals that define your business / main touch points
 Put in a scalable system for tracking and reporting on goals
 Start using the form-submission method
 Teach your peers how to get more out of using better analyses/data
Final thoughts
16
www.adaptiveinsights.com
Michael Freeman, @spanishgringo
mfreeman@adaptiveinsights.com
@spanishgringo
Thank you!
17Michael Freeman, @spanishgringo
Appendix – goalCompletion functions
18Michael Freeman, @spanishgringo
Goal tracking with goalCompletion
var goalCompletion = {
bindFormSubmit: function(conversionType, trackPath, goalValue) {//code},
trackGoal: function(conversionType, trackPath, goalValue) {//code},
trackGoal_ga: function(a, b, c) {//code},
trackGoal_optimizely: function(a, b, c) {//code},
trackGoal_bing: function(a, b, c) {//code},
//add more services here
//end goalCompletion
}
19Michael Freeman, @spanishgringo
goalCompletion.bindFormSubmit()
bindFormSubmit: function(conversionType, trackPath, goalValue) {
try {
//add in validation code if you use a 3rd party validator like jQuery Validate
// if (form is valid){ call the submit hander in the validate object etc…}
$("form").submit(function(){
goalCompletion.trackGoal(conversionType, trackPath, goalValue);
});
} catch (e) {}
}
20Michael Freeman, @spanishgringo
goalCompletion.trackGoal()
trackGoal: function(conversionType, trackPath, goalValue) {
//set goal defaults if none passed
goalCompletion.conversionType = conversionType || goalCompletion.conversionType || "unknown-conversion";
goalCompletion.trackPath = trackPath || goalCompletion.trackPath || document.location.pathname;
goalCompletion.goalValue = goalValue || goalCompletion.goalValue || 100;
if((/^[1-5]//).test(goalCompletion.conversionType)) {
goalCompletion.conversionType = "/form/" + goalCompletion.conversionType;
}
try{
// fire off GA
goalCompletion.trackGoal_ga(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue);
} catch(error) {
console.log("errorGA:n" + error);
}
try{
// fire off Optimizely
goalCompletion.trackGoal_optimizely(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue);
} catch(error) {
console.log("errorOpt:n" + error);
}
/* services not in use right now */
//goalCompletion.trackGoal_linkedIn(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue);
//goalCompletion.trackGoal_acme(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue);
}
21Michael Freeman, @spanishgringo
goalCompletion.trackGoal_ga()
trackGoal_ga: function(conversionType, trackPath, goalValue) {
if (typeof gaCookie != "undefined") {
gaCookie.getVisitData();
}
if (_gaq) {
_gaq.push(['_trackPageview', (trackPath.substr(-1) == "/" ? trackPath.substr(0, trackPath.length-1) : trackPath) +
conversionType]);
}
22Michael Freeman, @spanishgringo
Resources to pass more web campaign information with form submissions
 https://moz.com/ugc/how-to-measure-roi-for-leadgen-websites
 https://github.com/spanishgringo/ga-campaign-tracking
Bonus Material – Passing GA data to Eloqua

More Related Content

Similar to Modern goal tracking stratgies for the web

Unique Ethical IssuesMarketing Ethics .docx
Unique Ethical IssuesMarketing Ethics .docxUnique Ethical IssuesMarketing Ethics .docx
Unique Ethical IssuesMarketing Ethics .docx
marilucorr
 
Analytics vendors and_package_impl-jamie_smith
Analytics vendors and_package_impl-jamie_smithAnalytics vendors and_package_impl-jamie_smith
Analytics vendors and_package_impl-jamie_smith
zachbrowne
 
Define, Setup, Analyze and Communicate your Data Deluge
Define, Setup, Analyze and Communicate your Data DelugeDefine, Setup, Analyze and Communicate your Data Deluge
Define, Setup, Analyze and Communicate your Data Deluge
MashMetrics
 

Similar to Modern goal tracking stratgies for the web (20)

SAP successfactors PMGM Online training in USA -empowerittraining
SAP successfactors PMGM Online training in USA -empowerittrainingSAP successfactors PMGM Online training in USA -empowerittraining
SAP successfactors PMGM Online training in USA -empowerittraining
 
AdWords Academy Conversion Tracking and Google Analytics 轉換追蹤和Google分析 (粵語-英文)
AdWords Academy Conversion Tracking and Google Analytics 轉換追蹤和Google分析 (粵語-英文)AdWords Academy Conversion Tracking and Google Analytics 轉換追蹤和Google分析 (粵語-英文)
AdWords Academy Conversion Tracking and Google Analytics 轉換追蹤和Google分析 (粵語-英文)
 
Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...
Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...
Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...
 
Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...
Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...
Dashboards that Set Your App Apart: The Complete Predictive Analytics Lifecyc...
 
Unique Ethical IssuesMarketing Ethics .docx
Unique Ethical IssuesMarketing Ethics .docxUnique Ethical IssuesMarketing Ethics .docx
Unique Ethical IssuesMarketing Ethics .docx
 
Content marketing analytics: what you should really be doing
Content marketing analytics: what you should really be doingContent marketing analytics: what you should really be doing
Content marketing analytics: what you should really be doing
 
Content Marketing Analytics - What you should really be doing... and probably...
Content Marketing Analytics - What you should really be doing... and probably...Content Marketing Analytics - What you should really be doing... and probably...
Content Marketing Analytics - What you should really be doing... and probably...
 
Odoo functional-training-v8-crm
Odoo functional-training-v8-crmOdoo functional-training-v8-crm
Odoo functional-training-v8-crm
 
6 Steps to Building the Ultimate Integrated Marketing Framework with Productb...
6 Steps to Building the Ultimate Integrated Marketing Framework with Productb...6 Steps to Building the Ultimate Integrated Marketing Framework with Productb...
6 Steps to Building the Ultimate Integrated Marketing Framework with Productb...
 
Analytics vendors and_package_impl-jamie_smith
Analytics vendors and_package_impl-jamie_smithAnalytics vendors and_package_impl-jamie_smith
Analytics vendors and_package_impl-jamie_smith
 
Scaling AutoML-Driven Anomaly Detection With Luminaire
Scaling AutoML-Driven Anomaly Detection With LuminaireScaling AutoML-Driven Anomaly Detection With Luminaire
Scaling AutoML-Driven Anomaly Detection With Luminaire
 
Google Analytics: Introduction & User Training
Google Analytics: Introduction & User TrainingGoogle Analytics: Introduction & User Training
Google Analytics: Introduction & User Training
 
[Webinar] What is Programmatic Job Advertising?
[Webinar] What is Programmatic Job Advertising?[Webinar] What is Programmatic Job Advertising?
[Webinar] What is Programmatic Job Advertising?
 
Hardcore PPC Tactics
Hardcore PPC TacticsHardcore PPC Tactics
Hardcore PPC Tactics
 
Google Interface and Installation
Google Interface and InstallationGoogle Interface and Installation
Google Interface and Installation
 
Digital marketing road map for a real estate company in india
Digital marketing road map for a real estate company in indiaDigital marketing road map for a real estate company in india
Digital marketing road map for a real estate company in india
 
Common Questions about Higher Ed Analytics
Common Questions about Higher Ed AnalyticsCommon Questions about Higher Ed Analytics
Common Questions about Higher Ed Analytics
 
SMX Advanced - When to use Machine Learning for Search Campaigns
SMX Advanced - When to use Machine Learning for Search CampaignsSMX Advanced - When to use Machine Learning for Search Campaigns
SMX Advanced - When to use Machine Learning for Search Campaigns
 
Define, Setup, Analyze and Communicate your Data Deluge
Define, Setup, Analyze and Communicate your Data DelugeDefine, Setup, Analyze and Communicate your Data Deluge
Define, Setup, Analyze and Communicate your Data Deluge
 
Analytics For Local Search
Analytics For Local SearchAnalytics For Local Search
Analytics For Local Search
 

Recently uploaded

anas about venice for grade 6f about venice
anas about venice for grade 6f about veniceanas about venice for grade 6f about venice
anas about venice for grade 6f about venice
anasabutalha2013
 
FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134
LR1709MUSIC
 
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBdCree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
creerey
 
Memorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.pptMemorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.ppt
seri bangash
 

Recently uploaded (20)

HR and Employment law update: May 2024.
HR and Employment law update:  May 2024.HR and Employment law update:  May 2024.
HR and Employment law update: May 2024.
 
What are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdfWhat are the main advantages of using HR recruiter services.pdf
What are the main advantages of using HR recruiter services.pdf
 
anas about venice for grade 6f about venice
anas about venice for grade 6f about veniceanas about venice for grade 6f about venice
anas about venice for grade 6f about venice
 
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-indiafalcon-invoice-discounting-a-premier-platform-for-investors-in-india
falcon-invoice-discounting-a-premier-platform-for-investors-in-india
 
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptxTaurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
Taurus Zodiac Sign_ Personality Traits and Sign Dates.pptx
 
Transforming Max Life Insurance with PMaps Job-Fit Assessments- Case Study
Transforming Max Life Insurance with PMaps Job-Fit Assessments- Case StudyTransforming Max Life Insurance with PMaps Job-Fit Assessments- Case Study
Transforming Max Life Insurance with PMaps Job-Fit Assessments- Case Study
 
Cracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptxCracking the Workplace Discipline Code Main.pptx
Cracking the Workplace Discipline Code Main.pptx
 
FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134FINAL PRESENTATION.pptx12143241324134134
FINAL PRESENTATION.pptx12143241324134134
 
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBdCree_Rey_BrandIdentityKit.PDF_PersonalBd
Cree_Rey_BrandIdentityKit.PDF_PersonalBd
 
Pitch Deck Teardown: RAW Dating App's $3M Angel deck
Pitch Deck Teardown: RAW Dating App's $3M Angel deckPitch Deck Teardown: RAW Dating App's $3M Angel deck
Pitch Deck Teardown: RAW Dating App's $3M Angel deck
 
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
RMD24 | Retail media: hoe zet je dit in als je geen AH of Unilever bent? Heid...
 
Team-Spandex-Northern University-CS1035.
Team-Spandex-Northern University-CS1035.Team-Spandex-Northern University-CS1035.
Team-Spandex-Northern University-CS1035.
 
Equinox Gold Corporate Deck May 24th 2024
Equinox Gold Corporate Deck May 24th 2024Equinox Gold Corporate Deck May 24th 2024
Equinox Gold Corporate Deck May 24th 2024
 
BeMetals Presentation_May_22_2024 .pdf
BeMetals Presentation_May_22_2024   .pdfBeMetals Presentation_May_22_2024   .pdf
BeMetals Presentation_May_22_2024 .pdf
 
Memorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.pptMemorandum Of Association Constitution of Company.ppt
Memorandum Of Association Constitution of Company.ppt
 
Accpac to QuickBooks Conversion Navigating the Transition with Online Account...
Accpac to QuickBooks Conversion Navigating the Transition with Online Account...Accpac to QuickBooks Conversion Navigating the Transition with Online Account...
Accpac to QuickBooks Conversion Navigating the Transition with Online Account...
 
Affordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n PrintAffordable Stationery Printing Services in Jaipur | Navpack n Print
Affordable Stationery Printing Services in Jaipur | Navpack n Print
 
Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111Introduction to Amazon company 111111111111
Introduction to Amazon company 111111111111
 
Strategy Analysis and Selecting ( Space Matrix)
Strategy Analysis and Selecting ( Space Matrix)Strategy Analysis and Selecting ( Space Matrix)
Strategy Analysis and Selecting ( Space Matrix)
 
Matt Conway - Attorney - A Knowledgeable Professional - Kentucky.pdf
Matt Conway - Attorney - A Knowledgeable Professional - Kentucky.pdfMatt Conway - Attorney - A Knowledgeable Professional - Kentucky.pdf
Matt Conway - Attorney - A Knowledgeable Professional - Kentucky.pdf
 

Modern goal tracking stratgies for the web

  • 1. 1 Michael Freeman – Director, Demand Generation & Marketing Operations San Francisco/Silicon Valley Eloqua User Group – March 23, 2016 Modern Goal Tracking Strategies & Analytics
  • 2. 2Michael Freeman, @spanishgringo WARNING - High Density Deck There's lots of text & few images
  • 3. 3Michael Freeman, @spanishgringo  We tend to improve what we measure  Good decisions are very hard without good data  Yet, good measurement practices are very rare Good measurement is the foundation of DG
  • 4. 4Michael Freeman, @spanishgringo  Not enough investment in understanding the data or what’s important to the business  Choose a path of least resistance for data gathering  We don’t think about the future Why don’t most marketers measure well?
  • 5. 5Michael Freeman, @spanishgringo OK, but what about goal tracking?
  • 6. 6Michael Freeman, @spanishgringo  Not enough investment in understanding the data or what’s important to the business – We setup the wrong goals to track  Choose a path of least resistance for data gathering – Data quality suffers & maintenance eats a lot of time  We don’t think about the future – A limited view of the data & can’t handle change well Goal tracking suffers as a result
  • 7. 7Michael Freeman, @spanishgringo Thank you page-based Pros  Quick to start using  Seemingly easy  Low technical knowledge needed Cons  Not scalable or very flexible  SEO/WEB needs != Data needs  Lots of maintenance Form submission-based Pros  Flexibility by using virtual URLs  Very rich data gathering  Separate tracking from UX & SEO  Low maintenance Cons  Requires some up-front planning  Higher technical requirements Goal tracking – a tale of two methods
  • 8. 8Michael Freeman, @spanishgringo 1. Create a common goal tracking function (GTF) – Define the variables to pass to the GTF • What? = Conversion Type • Where? = Location • So What? = Goal Value – Hook in your various goal tracking services – Host it in a common location such as Google Tag Manager 2. Form preparation – Determine how you’ll pass the variables to the GTF – Setup a global form listener for onSubmit events 3. Configure goals in your analytics services, as necessary Setting up the form submission method
  • 9. 9Michael Freeman, @spanishgringo  conversionType (required): This will tell us where to bucket the conversion in our tracking systems. – I recommend using a number followed by a forward slash and description of the conversion in short, URL-style text. – 2/online-demo, 1/contact-us, 3/asset-download, 1/free-trial  trackPath (optional): The location of the form completion. In almost all circumstances it will be defined by the value of window.location.pathname  goalValue (optional): This value captures the $-value we associate with a goal completion. In most cases this will be a static value associated with the conversionType and is typically used dynamically only in ecommerce situations trackPath + "/form/" + conversionType "/products/adaptive-suite" + "/form/" + "2/online-demo" /products/adaptive-suite/form/2/online-demo The what, where, & how much of tracking
  • 10. 10Michael Freeman, @spanishgringo  goalCompletion: the namespaced object to handle all logic  bindFormSubmit: sets the event listener for onSubmit and calls trackGoal  trackGoal: fires off all of the individual tracking functions for each service  trackGoal_ga: fires off the call to GA  trackGoal_optimizely: fires off the call to Optimizely  trackGoal_bing: fires off the call to Bing Ad Center  Etc. Anatomy of goalCompletion {}
  • 11. 11Michael Freeman, @spanishgringo Load goalCompletion from GTM <script type="text/javascript"> try { if (typeof goalCompletion === "undefined") { $.ajax({ url: "//yourwebsite.com/assets/js/goalCompletion.js", dataType: "script", cache: !0 }).done(function(){ //look for any eloqua forms and bind the submit handler if ($('#eloquaForm').length > 0) { //insert code here to set the conversion variables goalCompletion.bindFormSubmit(typeof conversionType == 'undefined' ? undefined : conversionType, typeof trackPath == 'undefined' ? undefined : trackPath, typeof goalValue == 'undefined' ? undefined : goalValue); } }); } } catch (error) {} </script> Google Tag Manager is a great way to include this script loader on all of your pages
  • 12. 12Michael Freeman, @spanishgringo Adding form-based goal tracking to GA • Make sure you choose regular expression • Use the same pattern to define form viewing for better funnel reports
  • 13. 13Michael Freeman, @spanishgringo  Form has default hidden field called conversionType  The form load handler reads the conversionType field value and sets the form submit handler variables  On form submission (passing html5 validation) the trackGoal function is called  All tracking services are updated Putting it all together
  • 14. 14Michael Freeman, @spanishgringo  We can track goal completions anywhere on the site  We can see where the form is most likely to be completed  We can create a separate set of goals to track Tier-2 goals  It's easy to update and maintain since it's tied to the form code, not the destination URL Putting it all together - continued
  • 15. 15Michael Freeman, @spanishgringo  Take the time to think about your reporting comprehensively  Use goals that define your business / main touch points  Put in a scalable system for tracking and reporting on goals  Start using the form-submission method  Teach your peers how to get more out of using better analyses/data Final thoughts
  • 17. 17Michael Freeman, @spanishgringo Appendix – goalCompletion functions
  • 18. 18Michael Freeman, @spanishgringo Goal tracking with goalCompletion var goalCompletion = { bindFormSubmit: function(conversionType, trackPath, goalValue) {//code}, trackGoal: function(conversionType, trackPath, goalValue) {//code}, trackGoal_ga: function(a, b, c) {//code}, trackGoal_optimizely: function(a, b, c) {//code}, trackGoal_bing: function(a, b, c) {//code}, //add more services here //end goalCompletion }
  • 19. 19Michael Freeman, @spanishgringo goalCompletion.bindFormSubmit() bindFormSubmit: function(conversionType, trackPath, goalValue) { try { //add in validation code if you use a 3rd party validator like jQuery Validate // if (form is valid){ call the submit hander in the validate object etc…} $("form").submit(function(){ goalCompletion.trackGoal(conversionType, trackPath, goalValue); }); } catch (e) {} }
  • 20. 20Michael Freeman, @spanishgringo goalCompletion.trackGoal() trackGoal: function(conversionType, trackPath, goalValue) { //set goal defaults if none passed goalCompletion.conversionType = conversionType || goalCompletion.conversionType || "unknown-conversion"; goalCompletion.trackPath = trackPath || goalCompletion.trackPath || document.location.pathname; goalCompletion.goalValue = goalValue || goalCompletion.goalValue || 100; if((/^[1-5]//).test(goalCompletion.conversionType)) { goalCompletion.conversionType = "/form/" + goalCompletion.conversionType; } try{ // fire off GA goalCompletion.trackGoal_ga(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue); } catch(error) { console.log("errorGA:n" + error); } try{ // fire off Optimizely goalCompletion.trackGoal_optimizely(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue); } catch(error) { console.log("errorOpt:n" + error); } /* services not in use right now */ //goalCompletion.trackGoal_linkedIn(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue); //goalCompletion.trackGoal_acme(goalCompletion.conversionType, goalCompletion.trackPath, goalCompletion.goalValue); }
  • 21. 21Michael Freeman, @spanishgringo goalCompletion.trackGoal_ga() trackGoal_ga: function(conversionType, trackPath, goalValue) { if (typeof gaCookie != "undefined") { gaCookie.getVisitData(); } if (_gaq) { _gaq.push(['_trackPageview', (trackPath.substr(-1) == "/" ? trackPath.substr(0, trackPath.length-1) : trackPath) + conversionType]); }
  • 22. 22Michael Freeman, @spanishgringo Resources to pass more web campaign information with form submissions  https://moz.com/ugc/how-to-measure-roi-for-leadgen-websites  https://github.com/spanishgringo/ga-campaign-tracking Bonus Material – Passing GA data to Eloqua