#Lasha-pi-source

1 messages · Page 1 of 1 (latest)

jolly meadow
#

Hey!

#

We don't natively track/store the page in which payment was initiated. That's something you'd need to do in your integration

#

How do you currently integrate with Stripe?

mellow sundial
#

no i want track that for users
they connect their stripe to my app and give me permission to track that
i get their clientId after that they will get my script and put it on page so they want to track succeeded payments on their page with my script

#

from which page come this payment

#

and i need to find way how get this information if you have some solution will be nice

hazy ermine
#

it really depends exactly what you build and how you integrate(hosted Checkout page, mobile app, embedded payment form,etc). There's no one generic solution for tracking that.

#

but overall I would use metadata so when you create the payment objects in the API and your code knows who you're doing it for, add metadata to the relevant objects. https://stripe.com/docs/api/metadata

mellow sundial
#

i will explain clearly.
main goal is to understand which payment belongs to which page.
i'm third party code i dont have access to client integration i only have their client id not secret key
so they will paste my tracking code on their page (like google script ) so i need somehow track payments which comes from page where my tracking code is pasted

#

i dont have access to their integration and i guess also i cant get this data from their post requests

#

or if there some way to get last 4 digits of card number when user fill the iframe input or something like that if i get this last 4 digits i can compare it to charge list from API

hazy ermine
#

I'm sure it's possible but I can't give you specific advice without seeing some code or knowing more about your integration

mellow sundial
#

i could not show you code because its in progress and i did not write that part but i will explain it how it will work and what i'm trying to do

there is tracking app where user can track what he want on their web page for example page views clicks with putting our script on their site (as google ) there is one feature with stripe where if user want they will connect stripe account to our app and give us their client id so we have client id of user

so if he connect stripe account to our app and paste this tracking code where he have stripe payment and choose to track where from come stripe payment i need to track how many payments come from that page

i thought about 2 solutions if when i get charge list of user with client id if there is way to get where from come this charges it will be enough for me and i can provide to him statistic
second one is if with my code i can get from stripe iframe last 4 digits but i guess its does not fit me because some of the payments are checkouts which go to stripe page and i cant get this last 4 digits because user fill it on stripe web site

so i need to know from where come this charges what i get with stripe API with client ID @hazy ermine

#

i hope i explain it well

hazy ermine
#

how does the customer get to your page from the client's page?

#

i could not show you code because its in progress and i did not write that part
can I suggest you build something first, since you'll probably figure this out naturally as part of building it

mellow sundial
#

he dont get my page
for example i'm tracking company and you have a website so you want to track from which page comes your stripe payments from your website so you connect your stripe account to my app so i get your permission and client id and i give you some script which you need to paste on your page so with this script i want to track payments

#

but it will be better if i can get from which webpage comes payment from your api
for example i get all charges stripe.charges.list and if there is way to get from which page come charge

#

@hazy ermine

hazy ermine
#

and i give you some script which you need to paste on your page so with this script i want to track payments
maybe you should customise the script you give you to each user so it includes a unique ID?

#

then you can pass that ID to the backend when your script calls your server to create a PaymentIntent, or however you specifically will integrate.

mellow sundial
#

i dont create payment i only want to track
Customer create stripe payment and integrate it by himself
i only want to get last 4 digits from stripe iframe input.

hazy ermine
#

well you can't really unless you are able to change the actual code the real merchant(the client who wrote the code that does the payment and mounts the Stripe form elements etc) to extract that information and send it to you.

#

you can't just passively have a script on the page that pulls that sort of information, as far as I know. But it's entirely possible for the merchant to customise their code to pull the information from the Stripe API and send that to you in some metrics/tracking call and you could give them instructions on how to do that — like provide a function trackLashaPayment and tell them to call it from their code with a unique key and some information from the Stripe API. Usually though you as the platform are providing the actual code that does the payment so you can make it do all that.

mellow sundial
#

Thanks but i guess its does not fit me in all cases
one more question:
stripe iframe throw events and its possible to get some information from that events or what kind of data is thrown by iframe ? @hazy ermine

exotic bison
#

karlekko had to step out but I can help. We have events for our Elements that one can listen to, though I am not sure if it is possible for you to subscribe to them in the situation that you described. https://stripe.com/docs/js/element/events

mellow sundial
#

okay, so you are saying that there is no way to track from frontend with third party script last 4 digits ?
so only way is to track that information is to add some functionality in integration code ?

exotic bison
#

As far as I know, yes. I think you will need your user to pass you that data or pass you their Stripe Element so that you can listen for events like this