Is this possible now?
Hi!
Just to clarify, are you asking about tracking ad conversions or a similar process? If so, you can check out this video on ad conversion tracking: Ad Tracking in Pickaxe
If you were referring to something else, could you please provide a bit more detail? In most cases, similar results can be achieved by implementing a setup like the ad conversion tracking process, using our Website Code Injection feature. Please let us know more about what you’d like to accomplish, and we’ll be happy to assist you further.
Hi @danny_support , thanks for the tutorial video, I am sure that will help a lot of people. Yes, I know how to set up tracking for sales in the website code injection, but I’m unsure of how to also track free trial submissions simultaneously within the code injector.
Do you have any idea if this can be accomplished yet? Or should I create another tracking pixel focused on leads, based on your example, and place that in the website code injection as well? I’m a bit confused about where to paste the code.
Normally, conversions for a lead on my website would occur on the thank-you page after the opt-in page. If someone buys from the sales page, another pixel would fire the conversion pixel for sales, which is located after the checkout page.
I am trying to determine if the website code injector can distinguish between “sales” and “lead” pixels to ensure they only fire when a free trial signs up for a lead and when someone pays a subscription fee, as sales. Does that make sense?
@danny_support following up on this since being able to track both leads and sales for my ad campaigns would really help.
Hi @rainmaker,
I’m actively investigating this and appreciate your patience and understanding in the meantime.
Hi @rainmaker,
I ran several tests on our end and consulted with our engineering team.
For tracking leads and sign-ups:
You should place your conversion tracking code in the Footer section within the Website Code Injection settings. This will enable your tracking pixel to fire when users complete the sign-up process.
For tracking purchases of paid products:
Add your conversion tracking code to the Confirmation Page Header section of the Website Code Injection. This ensures your pixel is triggered when a user reaches the confirmation page after a successful purchase.
Regarding tracking free products:
When users purchase free products, they are granted access immediately and are not redirected to a confirmation page. Because of this, standard confirmation page tracking will not capture these events. To address this, you can use a custom script that specifically targets the “Next” and “Checkout” buttons used in free product purchases. Here is an example you can adapt for your own conversion ID:
<script>
function gtag_report_conversion(url) {
var callback = function () {
if (typeof(url) != 'undefined') {
window.location = url;
}
};
gtag('event', 'conversion', {
'send_to': 'AW-XXXXX/XXXXX',
'value': 1.0,
'currency': 'USD',
'event_callback': callback
});
return false;
}
function attachConversionToNextOrCheckout() {
var buttons = document.querySelectorAll('button.text-white.bg-c-blue');
buttons.forEach(function(btn) {
// Attach only to "Next" or "Checkout" buttons
var buttonText = btn.textContent.trim().toLowerCase();
if (
(buttonText === "next" || buttonText === "checkout") &&
!btn.dataset.conversionAttached
) {
btn.addEventListener('click', function(e) {
gtag_report_conversion();
});
btn.dataset.conversionAttached = "true";
}
});
}
// Attach on load and watch for DOM changes
document.addEventListener("DOMContentLoaded", function() {
attachConversionToNextOrCheckout();
const observer = new MutationObserver(function() {
attachConversionToNextOrCheckout();
});
observer.observe(document.body, { childList: true, subtree: true });
});
</script>
Please be sure to update the ‘send_to’ field in the script with your unique Google Ads conversion ID. You should place this script in the Footer section of your Website Code Injection, not in the Confirmation Page Header or Footer. If you already have a script for tracking sign-ups, it is perfectly fine to include a second script tag for tracking free product purchases or other conversion events.
Wow, thanks @danny_support for the thorough answer! You definitely should get a raise for this one! Appreciate it and keep up the good work. I only needed the leads and sales answer, but thanks for going the extra mile regarding free products as well!