Tracking Code: Purchase Complete from AdForm into Magento2
- or -
Post a project like this1821
£132(approx. $166)
- Posted:
- Proposals: 5
- Remote
- #2364305
- Awarded
Description
Experience Level: Expert
I need to integrate the tracking code below so that it fires once a purchase has been confirmed. We’re running M2.3 with the Claue theme.
Within the script there are slots for 3 variables: Revenue, Basket Size, and Product. We’d need the relevant values present at the time of purchase sent to us via this script? Specifically, the segments are highlighted in yellow here, and the single quotes wrapped around them are to be kept:
order : {
sales: '',
basketsize: '',
itms: [{
productname: ''
}]
I’ve also included some documentation here, which will detail further on how to implement the script, and also on how to grab variables:
http://support.adform.com/documentation/implement-tracking-points/standard-javascript/unique-naming/
Code for integration below:
----------------------------------------------------------------------------------------------
Tracking Code: Standard (Asynchronous) "Purchase Complete"
----------------------------------------------------------------------------------------------
window._adftrack = Array.isArray(window._adftrack) ? window._adftrack : (window._adftrack ? [window._adftrack] : []);
window._adftrack.push({
pm: 1643835,
divider: encodeURIComponent('|'),
pagename: encodeURIComponent('Purchase Complete'),
order : {
sales: '',
basketsize: '',
itms: [{
productname: ''
}]
}
});
(function () { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://track.adform.net/serving/scripts/trackpoint/async/'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })();
Many thanks
Within the script there are slots for 3 variables: Revenue, Basket Size, and Product. We’d need the relevant values present at the time of purchase sent to us via this script? Specifically, the segments are highlighted in yellow here, and the single quotes wrapped around them are to be kept:
order : {
sales: '',
basketsize: '',
itms: [{
productname: ''
}]
I’ve also included some documentation here, which will detail further on how to implement the script, and also on how to grab variables:
http://support.adform.com/documentation/implement-tracking-points/standard-javascript/unique-naming/
Code for integration below:
----------------------------------------------------------------------------------------------
Tracking Code: Standard (Asynchronous) "Purchase Complete"
----------------------------------------------------------------------------------------------
window._adftrack = Array.isArray(window._adftrack) ? window._adftrack : (window._adftrack ? [window._adftrack] : []);
window._adftrack.push({
pm: 1643835,
divider: encodeURIComponent('|'),
pagename: encodeURIComponent('Purchase Complete'),
order : {
sales: '',
basketsize: '',
itms: [{
productname: ''
}]
}
});
(function () { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = 'https://track.adform.net/serving/scripts/trackpoint/async/'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); })();
Many thanks
Andrew C.
100% (1)Projects Completed
1
Freelancers worked with
1
Projects awarded
100%
Last project
16 Apr 2019
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies