{"section":"tutorials","requestedLocale":"en","requestedSlug":"setting-up-nethone-antifraud","locale":"en","slug":"setting-up-nethone-antifraud","path":"docs/en/tutorials/payments/payment-settings/setting-up-nethone-antifraud.md","branch":"main","content":"Nethone is an anti-fraud solution that identifies specific aspects of user behavior and minimizes the risk of fraud in your store's transactions by using artificial intelligence and machine learning.\n\n> ⚠️ You can integrate your store with Nethone via **Application Key (App Key)** and **Application Token (App Token)**. You will find this information in the plugin package that Nethone will send you after you sign the contract. If you have any questions, please contact the Nethone support team.\n\nTo set up Nethone in your store, you will need to:\n\n- [Configure Nethone’s anti-fraud solution](#configuring-nethones-anti-fraud-solution)\n- [Associate Nethone’s solution with a payment condition](#associating-nethones-solution-with-a-payment-condition)\n- [Enable Google Tag Manager at checkout](#enabling-google-tag-manager-at-checkout)\n- [Configure Google Tag Manager](#configuring-google-tag-manager)\n- [Create a tag trigger](#creating-a-tag-trigger)\n\nOnce the configuration process is complete, each purchase attempt will be analyzed by the anti-fraud solution and displayed on your Nethone dashboard.\n\n## Configuring Nethone’s anti-fraud solution\n\n1. Go to the VTEX __Admin__.\n2. Access the __Payments__ module.\n3. Click on __Settings__.\n4. In __Gateway Affiliations__, click on the green “__+__” button.\n5. In the __Anti-fraud__ section, select the __Nethone__ option.\n6. In the __Affiliation name__ field, enter __Nethone__.\n7. In the __Application Key__ and __Application Token__ fields, enter the data you received in the plugin package.\n8. Click on __Save__.\n\n## Associating Nethone’s solution with a payment condition\n\nTo perform the anti-fraud analysis, the Nethone affiliation must be associated with a payment condition. You can either use an existing condition or create a new one. Follow the instructions below:\n\n1. Go to the VTEX __Admin__.\n2. Access the __Payments__ module.\n3. Click on __Settings__.\n4. In the __Payment conditions__ tab, select an existing condition, or check out the [Configuring a payment condition](/en/tracks/pagamentos--6GAS7ZzGAm7AGoEAwDbwJG/6bzGxlz4inf8sKmvZ1c7i3?&utm_source=autocomplete) tutorial to create a new one.\n5. Make sure the payment condition is __Active__.\n6. After selecting or creating a new condition, enable the option __Use anti-fraud solution__.\n7. Select the __Nethone__ option.\n8. Click on __Save__.\n\n## Enabling Google Tag Manager at checkout\n\nThe next step for configuring the Nethone affiliation is integrating with Google Tag Manager via Javascript. \n\n1. [Click here](http://tagmanager.google.com) to access Google Tag Manager.\n2. Log in to your account. If you don't have an account yet, please create one.\n3. In the Google Tag Manager workspace, look for a number that starts with __GTM-XXXX__. Copy that number.\n4. Go to your VTEX __Admin__.\n5. Access the __Store setup__ section.\n6. Click on the __Checkout__ option.\n7. In the __Default__ card, click on the gear icon.\n8. In the top menu, select the __Checkout__ tab.\n9. In the __Google Tag Manager field__, paste the identifier number you copied from the workspace. \n10. Click on __Save__.\n\n## Configuring Google Tag Manager\n\n> ⚠️ The configurations documented below are to be performed on a system external to VTEX and may be discontinued without notice.\n\nOnce you have configured your account ID number at checkout, follow the instructions below to track purchase attempts made in your store.\n\n1. [Click here](http://tagmanager.google.com) and sign in to Google Tag Manager.\n2. On the left sidebar, click on __Variables__.\n3. In the __User-Defined Variables__ section, click on __New__.\n4. In __Variable Configuration__, click on the pencil icon.\n5. In the __Utilities__ section, select the __Constant__ option.\n6. Name the variable __profilerUrl__.\n7. In the __Value__ field, enter the link provided by Nethone in the plugin package you received.\n9. Click on __Save__.\n\n## Creating a tag trigger\n\nOnce the variable has been created, follow the steps below to define the triggers:\n\n1. In Google Tag Manager’s sidebar, click on __Triggers__.\n2. Click on __New__.\n3. Name the trigger __Profiler Trigger__.\n4. In __Trigger Configuration__, click on the pencil icon.\n5. In the __Other__ option, click on __Custom Event__.\n6. In the __Event name__ field, enter the following information including the parentheses: (email|profile|shipping|payment).\n7. Enable the __Use regex matching__ option.\n8. In __This trigger fires on__, select __Some Custom Events__.\n9. Select the options __Page Path__, __Matches RegEx__, __Checkout__.\n10. Click on __Save__.\n11. Return to the workspace and click on __Tags__. \n12. Click on __New__.\n13. Under __Tag Configuration__, click on the pencil icon.\n14. In the __Custom__ section, select the __Custom HTML__ option.\n15. Paste the following code into the HTML field, and ensure that the value in the __src=\"your profiling link\"__ field is the same as the one provided by Nethone in the plugin package.\n\n ```\n    <script type=\"text/javascript\" id=\"nthScript\" crossorigin=\"use-credentials\"\n    src=\"yourprofilinglink\" async></script>\n    <script>\n    (function() {\n    function uuidv4() {\n    return\n    'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n    var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r &\n    0x3 | 0x8);\n    return v.toString(16);\n    });\n    }\n    var attRef = uuidv4();\n    window.vtex.deviceFingerprint = attRef;\n    var options = {\n    attemptReference: attRef,\n    sensitiveFields: []\n    };\n    if (window.dftp) {\n    dftp.init(options);\n    } else {\n    var el = document.getElementById(\"nthScript\");\n    el.addEventListener(\"load\", function() {\n    dftp.init(options);\n    });\n    }\n    })()\n    </script>\n    ```\n16. Enable the __Support document.write__ option.\n17. Expand the __Advanced Settings__, and in the __Tag firing option__ field, select __Once per page__.\n18. On the __Triggers__ menu, click on the pencil icon.\n19. Select the __Profiler Trigger__ option and click on __Save__. \n20. Click on __Submit__.\n21. In the __Version Name__ field, enter *Nethone Profiler* and click on __Publish__.\n\nOnce this is done, the Nethone Anti-Fraud will have been installed correctly and will be ready to process your transactions."}