Skip to content

Commit

Permalink
Create README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
davodsaraei committed Jul 4, 2020
1 parent af89f45 commit f370d34
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# affili-js
Affili Javascript Conversion Tracker

## Simple usage
To install the affili-js conversion tracker, copy the following code and paste it immediately after the <head> tag on every page of your site. Replace ACCOUNT_ID with the ID of the your account id.

```Javascript
<script async src="/affili-js-last.js"></script>
<script>
window.affiliData = window.affiliData || [];
function affili(){affiliData.push(arguments);}

affili('create', ACCOUNT_ID);
affili('detect');
</script>
```

## Track Conversion
To track conversions run the following code in a goal page or call it when the conversion happend.
For example when a customer buy the product, the following code need to run at the thank you page.
Replace EXTERNAL_ID with the invoice number, AMOUNT with the amount of conversion, COMMISSION_KEY with the key of commission where defined in the panel.


```Javascript
affili('conversion', EXTERNAL_ID, AMOUNT, COMMISSION_KEY)
````

0 comments on commit f370d34

Please sign in to comment.