Reputation: 6029
Before I explain the issue it's worth noting at the start I do not have access to any html
or server side code
.
I'm tagging a website for a client, their website is some what similar to an ecommerce platform, there are 3 stages the user goes through before purchasing which are as follows:
add
button, then press submit which takes them to Step 2The issue I'm experiencing and trying to solve is this:
I'm setting up an ecommerce purchase event, inside this event I'm trying to pass the transaction information, along with the product information.
The transaction / product information is only located on Step 3. This event I'm setting up needs to fire on the confirmation page as this is when we know the submission has taken place and the order has been received.
I've gone through documentation around ecommerce events and I'm yet to find if any, anything that can help solve the issue. I was hoping to find a solution whereby I can build the ecommerce event on Step 3 and on the confirmation page fire the event. Any suggestions?
Upvotes: 0
Views: 172
Reputation: 618
I personally would try to review the requirements, the average transaction product quantity and then decide to go with JavaScript client-side code(implemented from GTM) to store the required product data on a cookie or the localstorage. Be careful though these solutions come with many limitations.
Cookies on mobile devices have smaller size restrictions for example.
The best way in my opinion is to communicate with the server-side developers. Because by doing this in the frontend you are risking many inconsistencies with the real data. Frontend code introduces browser compatibility issues, turned-off javascript and many more.
Also until you find a more suitable approach, you can scrape the minimum required information for the products and transaction, directly from the order-complete page. This could be done with pure-js or jQuery if it is available.
Upvotes: 1