How to track purchases of specific products as a goal
In some cases, we want to test if we can improve sales of a specific product or a group of products, rather than improving sales across the board.
For example, we are planning to launch a test where we add additional, product-specific content for 10 of our products. In the end, we want to see if we can improve sales for those 10 specific products. However, there's not an easy way to do this. As far as I know, the only way is to set up 10 individual events that fire when each of those products is purchased, set them up as goals, and track each campaign against the correct goals.
Is there any way to make this easier? Setting this up is time-consuming (trust me, I'm going through it currently). Does anyone know of a different way to do this? Like if we pass in a string of product ids as a property for each purchase event, can we create a goal that fires only if certain ids are found in that string?
-
Hi Ben,
You can use the Wait For Event api to do what you are describing with events. Documentation is here. The idea being that you subscribe to events being sent to DY, check if the event is purchase, then if it matches your list of skus, if so then fire your single event.
Here is a quick example of what I think you're describing:
-
Thanks & hey Logan Mcbride! I ended up not using this exact solution, but this sparked an idea of how I could get this done with GTM & just implemented it, and it appears to be working. Now I see why the call you Logan the Magnificent hahaha!
-
@... hahaha
Well the reason I had to do a workaround is that a single style of ours -- like the Stryke Pant for example https://www.511tactical.com/stryke-pant.html -- can have like 400 separate skus because there's a different sku for each size/color combination. So loading up the list of skus for multiple products like in Logan's example would've been too much to maintain.
But in our GTM dataLayer at the point of purchase we have a JSON object with all of the style numbers (ie group ids) included in the purchase. So basically instead of looping through the product ID array from the DY event, I'm looping through the JSON object of style numbers that we have in our dataLayer.
Does that make sense? If group_id were accessible in the DY purchase properties, I would've just used Logan's example, but since it's not I used this workaround.
-
Hi Ben, Yes this is great, thank so much for sharing.
It is possible to add a custom attribute of group_id, so if you need this in the future, @... or Logan Mcbride can give you the details.
-
@... How would you go about getting group_id or categories for a specific product that was purchased like you mentioned in your previous comment?
cc:@... Logan Mcbride
-
Hey Ben Zitney,
You can use the getProductData api to get any data feed info about a product from the client-side. Here is an example that of how this would look on a product page, but you can run it on any page as long as you know the product sku:
Please sign in to leave a comment.
Comments
10 comments