Anyone ever built a way to track whether a product...
# replo-help
a
Anyone ever built a way to track whether a product was added to cart (and purchased) via a Replo template vs not?
p
Hi, this is Andres from Replo team. Each page will have its own analytics so the actions from that page corresponds to Replo.
a
hey @Andres Castillo! Im talking more about adding some code that gets passed through as an Order Line Item Property
CleanShot 2024-07-08 at 12.33.02@2x.png
p
There's no native feature for that on Replo, only integrations with analytics https://support.replo.app/articles/1858909966-do-replo-pages-work-with-my-existing-analytics Adding an attribute for the order will require hardcoding.
a
gotcha. thanks!
👍 1
n
@Andy Fisher we do support cart line-items with a little bit of custom code though! let me find the doc
should be as simple as
Copy code
<input type="hidden" name="properties[My Property]" value="Added Via Replo" form="product-form-{{ product.id }}">
or something like that, but yeah we don't have support for order properties at the moment
a
@Noah Gilmore oh interesting!
for this use case, i dont want to visualize this in the cart, but have it be a hidden field that only appears in shopify admin at the line item.
i'll play around a bit.
a
yea that works! @Noah Gilmore
The only issue is its only grabbing the primary product and not the secondardy product (the upsell component) that i really care about: https://bark.co/products/the-bright-dental-kit-subscription?variant=40978242699351
said another way, its appending the line item attribute to only the primary product but not to the upsell product.
CleanShot 2024-07-08 at 17.59.28@2x.png
p
Hey Andy, Thank you for your reply. I will check with the team and get back to you on this. Regards,
ah hm, I see...so this works based on the presence of a Product component for that upsell product. I think in theory, you could wrap the upsell in a different Product component, with the upsell product selected, and put the custom HTML snippet inside that product component as well. Bit of a hack but it actually might work!
a
@Noah Gilmore tried this and i don't think its working as expected....maybe there's a way to adjust the code to look for multiple product ID's being added to cart?
n
hmm
I don't see this being inside of a Product container for the upsell product
a
i removed it.
lemme add back
n
you can also create a copy of the page as well 👍
a
just re-added.
since its a PDP template...its hard to test without jsut changing it live.
so its adding both attributes to the primary product and nothing to the upsell product
gonna try removing the primary code
n
oh, you can duplicate the template and just not assign it to any products. Then publishing it won't change anything live, but you can still preview using the "view live page" button
a
and add to cart actions still work in preview?
n
yep!
I think this is the issue. You'll want to set this to the upsell product, not the template product
a
ahh interesting
well there are 2 differnt products.
in that upsell component i built
n
oh, yeah I see. You may need to do the template product at first, then use the Update Current Product interaction to change it
a
fwiw, i built all this custom because the Rebuy "PDP Upsell/Add on's" feature wasn't working in Replo. If that was working, i think it would automagically cover most of the use cases 🙂
n
hm interesting - what do you mean by "not working" there? https://support.replo.app/articles/17513367706765-Rebuy is our docs about rebuy but I don't think we have specific documentation for the upsell/addons feature
a
I tried using this component first for this project but after it wasnt adding to cart correctly, i reach out to Relpo support who said that this comonent wasnt working properly globally.
the component renders properly, but when user interacts with the component it doesnt properly add the add on products to cart.
but maybe ill try again now that i know more about how to do this custom 🙂
n
Interesting, will try and find that support ticket and follow up
a
thanks!