Code Ratchet
Code Ratchet

Reputation: 6029

Ecommerce Purchase event, fire on seperate page

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:

  1. Step 1 - Choose items from a table and click add button, then press submit which takes them to Step 2
  2. Step 2 - User can modify the quantity of each product they have selected to purchase or remove the product once finished they press submit which takes them to step 3
  3. Step 3 - On this page the user can only submit the order, once they've submitted they're taken to a confirmation page - saying thanks order received etc

The 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

Answers (1)

Igneel64
Igneel64

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

Related Questions