• Hey there! Welcome to TFC! View fewer ads on the website just by signing up on TF Community.

[Axis] Automatic credit card transaction and rewards tracker

ChurningNoob

TF Ace
VIP Lounge
TLDR –
  • Every hour all credit card transactions are automatically fetched from your email
  • Transactions are added to google sheet
  • Expected default rewards generated and milestones achievement calculated
  • The emails processed are labeled so that there no duplicate transactions
  • Project moved here : https://github.com/TheSidd/EmailExpenseTracker
Drawbacks –
  • Refunds cannot be calculated as no email
  • If email template is changed by the bank, need to modify script
Security & Privacy –
  • Main reason to create this and not rely on third-party apps
  • Everything remains private in your account
Before you begin –
Steps –
  1. Visit script.google.com in browser where only one google account is logged in
  2. Click on Create app scripts
  3. Replace Code.gs content with https://gist.github.com/TheSidd/d439779aa048ebcbe9a51ff0514c5751#file-code-gs
  4. Paste your copied excel URL in line 62
  5. Click Save
  6. Left panel Files – Click on Add a file (+ icon) – then HTML – Rename with messages and replace contents from https://gist.github.com/TheSidd/d439779aa048ebcbe9a51ff0514c5751#file-messages-html
  7. Left panel Files – Click on Add a file (+ icon) – then HTML – Rename with parsed and replace contents with https://gist.github.com/TheSidd/d439779aa048ebcbe9a51ff0514c5751#file-parsed-html
  8. Click Save icon
Now your script should look like this

1671014914488.png

  1. Click on Deploy – New Deployment
  2. Now on the pop up click on Setting – select Web App – Provide description and click Deploy
  3. Now Authorize access to script, you will receive warning
  4. Click on Advance – then Click Go to Project-name (unsafe)
  5. Click on allow
  6. A URL should be generated, open and you should see your transactions.
  7. Click on Save data to Sheet
  8. Verify the data in excel
Should look like this, but with data filled

1671015028176.png

If everything is good so far, we can trigger this every hour.
  1. Back to the script page
  2. On left panel click on Triggers (Clock icon)
  3. Add trigger
  4. Select and save the trigger with these options
EDIT : Choose which deployment should run - click dropdown and select your latest deployment.
1671015078847.png

This will trigger the script and fetch details every hour.

So how will it look finally?

image.png

image.png


1671019779982.png
 

Attachments

  • 1671014816654.png
    1671014816654.png
    14 KB · Views: 90
  • 1671014983955.png
    1671014983955.png
    20.7 KB · Views: 101
Last edited:

kej

TF Premier
RML Group
VIP Lounge
@Sidd
This is freaking amazing!! :love:(y)

I may have found a bug in your code, the script is recording transactions even for "declined" emails.

Below is an example of email content for your reference:

Subject: "Transaction declined for Transaction alert on Axis Bank Credit Card no. XX1111"

Mail Body: "Please note that transaction attempt for INR 499.51 on your Axis Bank Credit Card no. XX1111 has been declined due to security reasons."
 

ChurningNoob

TF Ace
VIP Lounge
@Sidd
This is freaking amazing!! :love:(y)

I may have found a bug in your code, the script is recording transactions even for "declined" emails.

Below is an example of email content for your reference:
Good catch.

Update the search query
Code:
GmailApp.search("newer_than:1d AND in:inbox AND from:axisbank.com AND subject:Transaction alert AND -label:axis_processed -declined",0,100);
 
Last edited:

ChurningNoob

TF Ace
VIP Lounge

kkk

TF Ace
VIP Lounge
@Sidd , first of all hats off for your effort.

I had few queries
1) Does it track eligible accelerated transaction or do we need to edit it manually?
2) Every time, I make changes in code.gs file, do I need to deploy. Or Save and run is enough?
 

anotheruser

TF Premier
VIP Lounge
I tried he steps provided and it showed correct result. Then I deleted the project and tried re-creating it again and now I am getting empty result. Do you know what could be the issue?
your emails must have been already labelled. you'll need to remove label from them and re-run
 

anotheruser

TF Premier
VIP Lounge
@Sidd , first of all hats off for your effort.

I had few queries
1) Does it track eligible accelerated transaction or do we need to edit it manually?
2) Every time, I make changes in code.gs file, do I need to deploy. Or Save and run is enough?
@Sidd . may be if gyftr emails are extracted separately , they might be useful here?
 

anotheruser

TF Premier
VIP Lounge
Here is a gyftr tracker that works with axis and hdfc inspired by @Sidd 's work/
use above with code,gs, rest all process remains same.
clone doc: https://docs.google.com/spreadsheets/d/1UEReQHew8_6B5BgtqMDq7EKX93L_q2h6RS-tE2xDdqo/edit?usp=sharing
in rate sheet, please add rate per voucher type for other type of vouchers in 'Rate' sheet. I have pre-filled with sample.
Voucher type :
axis: in Email everything between 'buying' and 'gift'
hdfc: Everything between 'buying' and 'from'

Note: Will only work if you have either single card per issuer or multiple cards per issuer but with same reward rates.

PS: Code can be optimized , plus, can add functionality to support multiplier rate change.
 

Subhajeet

TF Select
we are getting struck and unable to complete the same can a video on the same be made please if possible and also a generic one to fetch and track all bank credit card details in excel would be much appreciated.
 

luckymurari

TF Premier
VIP Lounge
Here is a gyftr tracker that works with axis and hdfc inspired by @Sidd 's work/
use above with code,gs, rest all process remains same.
clone doc: https://docs.google.com/spreadsheets/d/1UEReQHew8_6B5BgtqMDq7EKX93L_q2h6RS-tE2xDdqo/edit?usp=sharing
in rate sheet, please add rate per voucher type for other type of vouchers in 'Rate' sheet. I have pre-filled with sample.
Voucher type :
axis: in Email everything between 'buying' and 'gift'
hdfc: Everything between 'buying' and 'from'

Note: Will only work if you have either single card per issuer or multiple cards per issuer but with same reward rates.

PS: Code can be optimized , plus, can add functionality to support multiplier rate change.
Thanks for this. Small typo in Code.GS.. Line 21 is missing curly braces open ..
 
Top