Slumpy Posted May 2 Share Posted May 2 (edited) Hi all, Just want to make sure I'm doing this correctly. I use a third party tool called GoodShuffle. I also use Google Ads. I want to use an event listener to report to google ads when a "Wishlist" is submitted (the equivalent of a checkout on an online store) I currently have my Google ads account tag already setup on my website. The Goodshuffle documentation isn't super clear to me, but it says the following needs to be added, I assume as a code snippet. // add listener for wishlist submit event document.addEventListener("gspro-wishlist.submit", function(data) { // get our data from the detail object var wishlistCount = data.detail.wishlist.length var clientFullName = data.detail.contact.firstName + " " + data.detail.contact.lastName // construct a message var message = clientFullName + " submitted a wishlist with " + wishlistCount + " items." // send to Google Analytics gtag('event', 'Submission', { 'event_category': 'Wishlist', 'event_label': 'Wishlist Submission', 'value': message }); }) https://docs.goodshuffle.dev/docs/integrations/events/#submit-wishlist The way I have it formatted is as follows in my footer: <script> document.addEventListener("DOMContentLoaded", function() { document.addEventListener("gspro-wishlist.submit", function(data) { // get our data from the detail object var wishlistCount = data.detail.wishlist.length var clientFullName = data.detail.contact.firstName + " " + data.detail.contact.lastName // construct a message var message = clientFullName + " submitted a wishlist with " + wishlistCount + " items." // send to Google Analytics gtag('event', 'Submission', { 'event_category': 'Wishlist', 'event_label': 'Wishlist Submission', 'value': message }); }); }); </script> Just wondering if my way would work with squarespace. I'd just run a test myself but to do so would mean changing my ad campaign and putting my ads back in the learning phase which costs money, potential business, etc. Thanks! - Tyler Edited May 2 by Slumpy misplaced sentence Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment