• Resolved techunmasked

    (@techunmasked)


    I’m trying to insert conversion tracking code on the “Thank you” (order-received) page displayed once someone successfully checks out in my WooCommerce store.

    I need to insert the code based on what product(s) has been ordered.

    So, basically:

    • If someone orders book 1, I need {book-1-pixel-code} inserted on the thank you page.
    • If someone orders book 2, I need {book-2-pixel-code} inserted on the thank you page.
    • If someone orders book 3, I need {book-3-pixel-code} inserted on the thank you page.
    • If someone orders book 1, book 2, and book 3, I need {book-1-pixel-code}, {book-2-pixel-code}, and {book-3-pixel-code} inserted into the thank you page.

    I have been searching for ways to do this without a custom script but have yet to find any solutions…any insight or possibilities to get this achieved would be greatly appreciated!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Do you need to use your own solution, or could you use something like Woocommerce Google Analytics? I believe there is a pro version with even more features if the free version won’t do it.

    Thread Starter techunmasked

    (@techunmasked)

    I wouldn’t need to use my own solution, any way I could insert the code would work…

    I don’t see how I could insert the tracking code(s) into the html on the page based on what products my customer ordered through that plugin though. Did I miss something?

    I was under the impression you just wanted to track conversions, and that Google Analytics e-commerce tracking would work. You wouldn’t need to use your own tracking codes for it. I guess I misunderstood.

    Thread Starter techunmasked

    (@techunmasked)

    Oh I see, sorry for the misunderstanding.

    I am wanting to track conversions, but I need to do so through Market Hero.

    The tracking pixel comes from them and it helps to keep my numbers straight from my email marketing efforts.

    Oh, I think I’m with you.

    If the tracking pixel is predictable, I’d probably go with overriding the /checkout/thankyou.php page in your child theme and adding them that way, but that depends on whether Market Hero is giving you a javascript snippet or just the raw source for the pixels. If they aren’t predictable, you might be able to add them as a custom attribute for each product, then grab them with a little PHP on a thankyou.php override. Of course, if you have a lot of products, adding the pixel source to all the products would be a really unpleasant task, and you’d have to remember to do it for every product you add.

    There’s a code snippet on Woocommerce’s site for adding a custom tracking code on the thankyou page, which you could put in your child theme’s functions.php instead of having to override the thankyou.php. That snippet looks like it could be adapted to do what you need whether the pixel source code is predicable or has to be included for a product.

    Unfortunately, all of those require a bit of coding.

    I do see a Woocommerce Conversion Tracking plugin, and the Custom Tracking looks promising, but it doesn’t look like it goes down to the product level. at least for the free version. You might be able to get the developer to add it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Insert Product-Specific Pixel Code at Thank You Page Based on Products Ordered?’ is closed to new replies.