Complete the code to add a conversion tracking pixel to a webpage.
<script>
function trackConversion() {
var img = new Image();
img.src = "https://example.com/track?event=[1]";
document.body.appendChild(img);
}
</script>The conversion tracking pixel URL should include the event type, such as 'purchase', to record the conversion properly.
Complete the code to send a conversion event using Google Tag Manager's dataLayer.
<script>
dataLayer.push({
'event': '[1]',
'transactionId': '12345'
});
</script>The event name 'conversion' is used to indicate a conversion event in Google Tag Manager's dataLayer.
Fix the error in the conversion tracking code by completing the missing parameter.
<script> gtag('event', 'conversion', { 'send_to': '[1]' }); </script>
The 'send_to' parameter requires the Google Ads conversion ID and label, formatted like 'AW-XXXXXXXXX/label'.
Fill both blanks to create a conversion tracking URL with parameters for source and medium.
https://example.com/thankyou?utm_source=[1]&utm_medium=[2]
The 'utm_source' parameter identifies the source like 'newsletter', and 'utm_medium' identifies the medium like 'email'.
Fill all three blanks to complete the JavaScript object for conversion tracking with event name, value, and currency.
var conversionData = {
event: '[1]',
value: [2],
currency: '[3]'
};The event name should be 'purchase' to indicate a conversion, the value is the amount spent, and the currency is 'USD' for US dollars.