Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

What is the proper syntax to pass a value into a purchase event?

dariusd91806962
Level 3
Level 3

OK I read that link but it didnt make much since for me. In our situation we do not sell several products at some fixed price. We provide Mortgage loans which can be at any value, so I can't hard code the value into the script. i have to capture that from the input box. Having said that, I am not clear about this portion of the script you suggest above.

s.products="loan1;aayydyyd;1;" + loanAmount; 
s.purchaseID="12341234" 
s.events="purchase"

what is---> "loan1;aayydyyd;1;" <---- what do the letters stand for.. aayydyyd.. ?

the purchaseId can that be fixed and always be -= to 12341234  or is this suppose to be dynamic and change each time?

 

  1.  
1 Accepted Solution
ParitMittal
Correct answer by
Level 10
Level 10

Hi Darius,

The way purchase event is being implemented is wrong. The loan amount needs to be passed in the s.products variable and the purchase only should be initialize in s.events syntax  followed by s.purchaseId variable. 

Hence the code should be like this :

$("input[name='loanAmount']").mouseleave(function(){ var loanAmount = $("input[name='loanAmount']").val(); if (loanAmount.length){ s.products="loan1;aayydyyd;1;" + loanAmount; s.purchaseID="12341234" s.events="purchase" } else { return false} });

Please see the following link for more information on this- https://marketing.adobe.com/resources/help/en_US/sc/implement/event_purchase.html

Thanks & Regards

Parit Mittal

View solution in original post

1 Reply
ParitMittal
Correct answer by
Level 10
Level 10

Hi Darius,

The way purchase event is being implemented is wrong. The loan amount needs to be passed in the s.products variable and the purchase only should be initialize in s.events syntax  followed by s.purchaseId variable. 

Hence the code should be like this :

$("input[name='loanAmount']").mouseleave(function(){ var loanAmount = $("input[name='loanAmount']").val(); if (loanAmount.length){ s.products="loan1;aayydyyd;1;" + loanAmount; s.purchaseID="12341234" s.events="purchase" } else { return false} });

Please see the following link for more information on this- https://marketing.adobe.com/resources/help/en_US/sc/implement/event_purchase.html

Thanks & Regards

Parit Mittal

View solution in original post