How to configure multiple events with numeric value | Community
Skip to main content
Level 2
October 11, 2023
Solved

How to configure multiple events with numeric value

  • October 11, 2023
  • 1 reply
  • 1238 views

We are currently passing total value of the order with numeric event. Below is an example of the same-

 

s.events = "purchase,event5="+ digitalData.order.orderGrandtotal;

 

Is it possible to add more numeric events in above mentioned code? 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

Hi,

 

I assume you mean that you want something like:

  • event5 - increment by the order grand total (as above)
  • event6 - increment by number of items in the order (example)
  • event7 - increment by how many searches the user performed before purchasing (ok, farfetched, but just another example 🙂 )

 

so you need to increment 3 separate numeric events?

 

You can just do this:

s.events = "purchase,event5=" + digitalData.order.orderGrandtotal + ",event6=" + digitalData.order.itemsInOrder + ",event7=" + digitalData.order.totalSearches;

 

So long as the resulting events string has the comma delimiter between your events ("purchase,event5=9.99,event6=2,event7=4") then this is fine.

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
October 11, 2023

Hi,

 

I assume you mean that you want something like:

  • event5 - increment by the order grand total (as above)
  • event6 - increment by number of items in the order (example)
  • event7 - increment by how many searches the user performed before purchasing (ok, farfetched, but just another example 🙂 )

 

so you need to increment 3 separate numeric events?

 

You can just do this:

s.events = "purchase,event5=" + digitalData.order.orderGrandtotal + ",event6=" + digitalData.order.itemsInOrder + ",event7=" + digitalData.order.totalSearches;

 

So long as the resulting events string has the comma delimiter between your events ("purchase,event5=9.99,event6=2,event7=4") then this is fine.

S_K_3_11Author
Level 2
October 11, 2023

Hi Jennifer,

 

It Works. Thanks for the help

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 11, 2023

You're welcome!

 

I too have a complex event implementation, so I do stuff like that a lot. So I'm happy to pass on any advice that will help other people out.