Installation
Remember to change the business_id
<script>
(function(m,a,k,e,i,n,f) {
m['MakeInfluenceObject']=i;m[i]=m[i]||{q:[]},
m[i]=new Proxy(m[i],{get:function(t,p,r){return t.hasOwnProperty(p)
?t[p]:function(){m[i].q.push({n:p,a:arguments})}}}),n=a.createElement(k),
f=a.getElementsByTagName(k)[0],n.async=1,n.src=e+'?'+Math.floor(new Date()
/864e5);f.parentNode.insertBefore(n,f);
})(window,document,'script','//scripts.makeinfluence.com/a.js', 'MI');
MI.set('business_id', 'e7d7f384-f563-11ea-a4a5-TEST');
MI.send('pageview');
</script>
Note: the MI.send('pageview'); doesn’t actually track pages. It only checks for our make influence query param, and installs a cookie.
The script above needs to be inserted right before the </body> inside the code on all pages.
<html>
<head>
<title>Hello world</title>
</head>
<body>
Your page content
<!-- PLACE SCRIPT HERE -->
</body>
</html>
Full js installation example
<html>
<head>
<title>Hello world</title>
</head>
<body>
Your page content
<script>
(function(m,a,k,e,i,n,f) {
m['MakeInfluenceObject']=i;m[i]=m[i]||{q:[]},
m[i]=new Proxy(m[i],{get:function(t,p,r){return t.hasOwnProperty(p)
?t[p]:function(){m[i].q.push({n:p,a:arguments})}}}),n=a.createElement(k),
f=a.getElementsByTagName(k)[0],n.async=1,n.src=e+'?'+Math.floor(new Date()
/864e5);f.parentNode.insertBefore(n,f);
})(window,document,'script','//scripts.makeinfluence.com/a.js', 'MI');
MI.set('business_id', 'abcd123-123-abc-123-abc-1234-TEST');
MI.send('pageview');
</script>
</body>
</html>
Conversion tracking - JS
💡 This is a block of HTML and JavaScript code that includes a MakeInfluence script. The script sets a business ID to identify the website, and sends a pageview and a conversion event with a unique ID, value, currency, and promotion codes. Make Influence is a tool for tracking and analyzing website traffic and conversions.
Requires the javascript library to be included
<script>
MI.send('conversion', {
unique_id: '346238746237',
value: '1250.00',
currency: 'DKK',
promotion_codes: [
'summersale2022',
'ditte10',
]
});
</script>
MI.send(’conversion’) - Params
Attribute | Type | Description |
unique_id | string/int | Unique ID of the conversion. The same ID can’t be tracked more than once. |
value | float | Send the value without any thousand separators, and max. 2 decimals for cents fx: 1200.00 |
currency | string | ISO 3166 (EUR,DKK) - Only EUR and DKK is currently supported |
promotion_codes | string/array | Any promotion code used for the conversion. |
Full conversion js example
<html>
<head>
<title>Hello world</title>
</head>
<body>
Thank you for the order/sign-up
<script>
(function(m,a,k,e,i,n,f) {
m['MakeInfluenceObject']=i;m[i]=m[i]||{q:[]},
m[i]=new Proxy(m[i],{get:function(t,p,r){return t.hasOwnProperty(p)
?t[p]:function(){m[i].q.push({n:p,a:arguments})}}}),n=a.createElement(k),
f=a.getElementsByTagName(k)[0],n.async=1,n.src=e+'?'+Math.floor(new Date()
/864e5);f.parentNode.insertBefore(n,f);
})(window,document,'script','//scripts.makeinfluence.com/a.js', 'MI');
MI.set('business_id', 'abcd123-123-abc-123-abc-1234-TEST');
MI.send('pageview');
MI.send('conversion', {
unique_id: '346238746237',
value: '1250.00',
currency: 'DKK'
promotion_codes: [
'freeDelivery',
'summer2022',
'laura12'
]
});
</script>
</body>
</html>
Conversion tracking - Server-to-Server
Server-to-server requests requires you to collect more information about the client on their conversion action.
Request type: POST
Attribute | Type | Description |
business_id* | string | A unique API key for creating conversions |
cookie_id* | string | Value of the cookie named _miid. This is the tracking cookie stored with the JS. It’s highly recommended to send this |
ip* | string | IP of the conversion action request. This cannot be your server IP, since the tracking simply wouldn’t work |
user_agent* | string | Full user agent string of the conversion action request |
created_at* | string | Must be sent as UTC+0 with the format Y-m-d H:i:s (2021-02-01 22:00:00 = The first of february 2021) |
unique_id | string/int | Unique ID of the conversion. The same ID can’t be tracked more than once. Typically, the order ID will do just fine. |
value* | float | Send the value without any thousand seperators, and max. 2 decimals for cents fx: 1200.00 |
currency* | string | ISO 3166 (EUR,DKK) - Only EUR and DKK is currently supported |
promotion_code | string | One or multiple (split with comma) promotion codes used for the conversion |
http_referer | string | Full HTTP referer of the conversion action request |
Description & Documentation
The table provided outlines the necessary information for creating a successful conversion API. The attributes listed in the table include the required and optional information that must be included in the API to accurately track and record a conversion.
The first required attribute is the business ID. This unique API key is used to create conversions and is specific to your business. The cookie ID is also required and is the value of the cookie named _miid. This cookie is stored with the JavaScript and it is highly recommended to send this for accurate tracking.
The IP address of the conversion action request is also a required attribute. It is important to note that this cannot be your server IP, since the tracking would not work. Additionally, the user agent of the conversion action request must be included. This is the full https://www.whatismybrowser.com/detect/what-is-my-user-agent.
The created_at attribute is also required and must be sent as UTC+0 with the format Y-m-d H:i:s (1. februar 2021 22:00:00 = The first of February 2021). The unique ID of the conversion must also be included and is a string or integer value. The same ID cannot be tracked more than once.
The value attribute is also required and must be sent without any thousand separators, with a maximum of two decimals for cents (e.g., 1200.00). Additionally, the currency attribute is required and must be ISO 3166 (EUR,DKK). Only EUR and DKK are currently supported.
The promotion_code attribute is optional and can include one or multiple promotion codes used for the conversion, separated by a comma. Finally, the HTTP referer of the conversion action request is optional and can be included as well.
It is important to send the required attributes correctly formatted in order to successfully track and record the conversion. Failure to do so may result in inaccurate tracking and reporting.
Testing the implementation
You need to click a valid tracking link, go to your conversion action, and complete it. If a conversion is tracked successfully, it can be viewed on the make influence sales report.