Another option is to use a conversion syntax merchandising eVar, you can set the expiry to a reasonable time (based on behaviours of your site... Visit may not be enough, if users have a tendency to go to a product page, add to cart, leave, then come back later and make a purchase later).
However, the basic operation of a conversion syntax variable, is that you set a value at whatever point you need (i.e. on the Product Listing Page View.. or maybe you actually want it when the Product is added to the Cart, etc).
Now, this will send the information to Adobe, but it won't actually appear in your reports yet (not on the PLP, not on the Add to Cart, etc)... the data will essentially be "held" until the binding event is triggered. In this case, you would use Purchase as the binding event.
So when the user make the purchase, during the processing of the data on the server, the merchandising eVar will be attached to the s.products for the purchase.
Let's look at an example:
- Home
- Category
- Product Page A
- set eVarX to "Product Page A" (You will see this in your testing, but not in your reports here)
- Add to Cart
- Category
- Feedback
- Cart
- Payment Flow
- Purchase
- s.products / purchase event is triggered here
When you look at your reports, on the purchase event, eVarX will say "Product Page A"
However, you might also get this:
- Home
- Category
- Product Page A
- set eVarX to "Product Page A"
- Add to Cart
- Category
- Product Page B
- set eVarX to "Product Page B"
- (They do not add to cart here)
- Cart
- Payment Flow
- Purchase
- s.products / purchase event is triggered here
When you look at your reports, on the purchase event, eVarX will say "Product Page B", even though Product B was not purchased... this was the last PLP that was viewed, but not necessarily engaged with...
Moving the Conversion Syntax eVar to set on the "Add to Cart" would tell you the last Product to be added to the cart, if this is something you are more interested in.
The best part about this, is that you don't have to worry about how many pages the user interacted with between the PLP and the Purchase event...