Which events you must trigger depends on your website type. See the relevant section based on your website’s objective:
“Required” events, if available on your website, must be passed in order to avoid pixel failure for that specific event. Before beginning your integration, be sure to review our Privacy Guidelines and Data Sharing Requirements.
page_view eventTrigger the page_view when a user navigates to a new page on your site.
Trigger this event on every page of your site and optionally include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
user_data | User data | false | Information about the user performing the event |
view_item eventTrigger this event when a user lands on a specific product page. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
items | Axon item[ ] | true | The items for the event |
currency | string | recommended | Three-letter ISO 4217 code for currency |
user_data | User data | false | Information about the user performing the event |
value | number | false | Monetary value of the event, calculated by the sum of price × quantity for each item |
add_to_cart eventTrigger this event when a user adds an item to their cart. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
items | Axon item[ ] | true | The items for the event |
currency | string | recommended | Three-letter ISO 4217 code for currency |
user_data | User data | false | Information about the user performing the event |
value | number | false | Monetary value of the items added to cart, calculated by the sum of price × quantity for each item |
begin_checkout eventTrigger this event when a user initiates the checkout process. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | true | Three-letter ISO 4217 code for currency |
items | Axon item[ ] | true | The items for the event |
value | number | true | Monetary value of the event, calculated by the sum of price × quantity for each item |
user_data | User data | false | Information about the user performing the event |
purchase eventTrigger this event when a user makes a purchase. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | true | Three-letter ISO 4217 code for currency |
is_new_customer | boolean | false | Only pass this if you are not using the AppLovin Shopify app and don't intend to upload order history data. true if this is a new customer, otherwise false. |
items | Axon item[ ] | true | The items for the event |
shipping | number | true | Shipping cost associated with the transaction. If no shipping cost, set this to 0. |
tax | number | true | Tax cost associated with a transaction. If no tax, set this to 0. |
transaction_id | string | true | The unique identifier of a transaction |
value | number | true | The total monetary amount due before tax and shipping (the subtotal) |
user_data | User data | true | Information about the user performing the event |
AppLovin recommends the events listed below, but they are not required:
add_payment_info eventTrigger this event when a customer submits their payment information to the site. For example, when a user fills in their payment information when they buy something. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | recommended | Three-letter ISO 4217 code for currency |
items | Axon item[ ] | recommended | The items for the event |
payment_type | Payment type | recommended | The payment type used |
value | number | recommended | Monetary value of the event, calculated by the sum of price × quantity for each item |
user_data | User data | false | Information about the user performing the event |
generate_lead eventTrigger this event when a potential customer expresses interest, typically by submitting a form. For example, when a user submits a contact form to receive more information about a product. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | true | Three-letter ISO 4217 code for currency |
value | number | true | The monetary value of the action, reflecting its quality or true value to your business. Pass a higher value for strong leads and 0 for duplicate submissions or low-quality leads. Leads with a value of 0 may be discounted or excluded from optimization. |
user_data | User data | false | Information about the user performing the event |
login eventTrigger this event when a user logs into an account on the site. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
user_data | User data | false | Information about the user performing the event |
sign_up eventTrigger this event when a user registers for an account on the site. For example, when a user registers for a new account by using their email or social media login. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
method | string | recommended | The method used for registration |
user_data | User data | true | Information about the user performing the event |
search eventTrigger this event when a user uses a search bar to search for content on your site. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
search_term | string | true | The term the user searched for |
results | Axon item[ ] | recommended | The items for the event |
user_data | User data | false | Information about the user performing the event |
subscribe eventTrigger this event when a user subscribes to a service. For example, when a user subscribes to a premium content service, such as an online magazine. Often this means that the user paid for a membership. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | false | Three-letter ISO 4217 code for currency |
user_data | User data | false | Information about the user performing the event |
value | number | false | Monetary value of the event |
remove_from_cart eventTrigger this event when a user removes an item from their cart. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
items | Axon item[ ] | true | The items for the event |
currency | string | recommended | Three-letter ISO 4217 code for currency |
user_data | User data | false | Information about the user performing the event |
value | number | false | Monetary value of the event, calculated by the sum of price × quantity for each item |
view_cart eventTrigger this event when a user views their cart. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
items | Axon item[ ] | true | The items for the event |
currency | string | recommended | Three-letter ISO 4217 code for currency |
value | number | recommended | Monetary value of the event, calculated by the sum of price × quantity for each item |
user_data | User data | false | Information about the user performing the event |
page_view eventTrigger the page_view when a user navigates to a new page on your site.
Trigger this event on every page of your site and optionally include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
user_data | User data | false | Information about the user performing the event |
generate_lead eventTrigger this event when a potential customer expresses interest, typically by submitting a form. For example, when a user submits a contact form to receive more information about a product. When you send this event, include these parameters:
| Name | Type | Required | Description |
|---|---|---|---|
currency | string | true | Three-letter ISO 4217 code for currency |
value | number | true | The monetary value of the action, reflecting its quality or true value to your business. Pass a higher value for strong leads and 0 for duplicate submissions or low-quality leads. Leads with a value of 0 may be discounted or excluded from optimization. |
user_data | User data | false | Information about the user performing the event |
Axon item is a common object required with most events. All fields must be named and formatted exactly as shown in the table below:
| Name | Type | Required | Description |
|---|---|---|---|
item_id | string | true | The ID of the item |
image_url | string | recommended | The URL to an image of the item. File extension must be .png, .jpg, or .jpeg. |
item_category_id | number | recommended | The category ID for the item (see Category IDs below). Send the integer ID of the category. |
item_name | string | recommended | The name of the item |
item_variant_id | string | recommended | The ID of the item variant, for example a size or color variation of the parent item. Every variant in your catalog must have a item_variant_id that is not shared by any other variant or item. |
price | number | recommended | The price of the item for a single unit. If a discount applies, set price to the discounted unit price, and specify the unit discount in the discount parameter. |
quantity | number | recommended1 | Item quantity |
affiliation | string | false | The specific supplier, company, or physical store associated with the product |
discount | number | false | The unit discount applied to the item |
item_brand | string | false | The brand of the item |
1 quantity is required for add_to_cart, remove_from_cart, and purchase events
User data contains additional information about the user. Only pass this data after you receive consent from the user.
| Name | Type | Required | Description |
|---|---|---|---|
email | string | true | The email of this user, for example “jdoe@example.com”. email must be lowercase. The pixel will hash it for you. |
phone | string | true | The phone number of this user, for example “12223334444”. phone must be digits only and include the country code. The pixel will hash it for you. |
user_id | string | true | Your unique identifier for the customer. This should be at least six characters. |
AppLovin hashes plaintext email addresses and phone numbers that you provide.
emailFor gmail.com and googlemail.com only, first remove all periods before
the @, and remove the first plus sign and everything after it. Leave the
domain unchanged. If nothing remains before the @, produce an empty value.
phone1 for United States phone numbers).
Then hash via SHA256.
For example (for email addresses):
| Input | Normalized | SHA256 |
|---|---|---|
Alice@Example.COM | alice@example.com | ff8d9819fc0e12bf0d24892e45987e249a28dce836a85cad60e28eaaa8c6d976 |
J..A.NE+work.more+extra@GMAIL.COM | jane@gmail.com | 988b074286b20c503e3015c2076533f3bf4ce5ca6f8a507ab52c2e0f98d620b7 |
Jane.Doe+Work@GoogleMail.com | janedoe@googlemail.com | 338abf9ef1c8793cadc7bcf51ed595338eb727ed9e06ce3d91d566d60b975937 |
Reference implementations follow. Each one prints the hash for the second example above; run it and confirm you get the same value.
#include <algorithm>
#include <cctype>
#include <iostream>
#include <regex>
#include <string>
#include <openssl/sha.h>
std::string normalizeAndHash(std::string email)
{
email.erase(0, email.find_first_not_of(" \t\n\r\f\v"));
email.erase(email.find_last_not_of(" \t\n\r\f\v") + 1);
std::transform(email.begin(), email.end(), email.begin(),
[](unsigned char c) { return std::tolower(c); });
static const std::regex valid("^[!-?A-~]+@[!-?A-~]+$");
if (!std::regex_match(email, valid))
return "";
const auto at = email.find('@');
std::string local = email.substr(0, at);
const std::string domain = email.substr(at + 1);
if (domain == "gmail.com" || domain == "googlemail.com")
{
local = local.substr(0, local.find('+'));
local.erase(std::remove(local.begin(), local.end(), '.'), local.end());
if (local.empty())
return "";
}
const std::string normalized = local + "@" + domain;
unsigned char hash[SHA256_DIGEST_LENGTH];
SHA256(reinterpret_cast<const unsigned char*>(normalized.data()),
normalized.size(), hash);
static constexpr char digits[] = "0123456789abcdef";
std::string out;
for (const unsigned char value : hash)
{
out += digits[value >> 4];
out += digits[value & 15];
}
return out;
}
int main()
{
std::cout << normalizeAndHash(" J..A.NE+work.more+extra@GMAIL.COM ") << "\n";
}
using System;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
class Program
{
static readonly Regex Valid = new Regex("^[!-?A-~]+@[!-?A-~]+$");
static string NormalizeAndHash(string email)
{
string trimmed = email.Trim(' ', '\t', '\n', '\r', '\f', '\v').ToLowerInvariant();
if (!Valid.IsMatch(trimmed))
return "";
int at = trimmed.IndexOf('@');
string local = trimmed.Substring(0, at);
string domain = trimmed.Substring(at + 1);
if (domain == "gmail.com" || domain == "googlemail.com")
local = local.Split('+')[0].Replace(".", "");
if (local.Length == 0)
return "";
using (SHA256 sha256 = SHA256.Create())
{
byte[] hash = sha256.ComputeHash(Encoding.UTF8.GetBytes(local + "@" + domain));
StringBuilder output = new StringBuilder(hash.Length * 2);
foreach (byte value in hash)
output.Append(value.ToString("x2"));
return output.ToString();
}
}
static void Main()
{
Console.WriteLine(NormalizeAndHash(" J..A.NE+work.more+extra@GMAIL.COM "));
}
}
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HexFormat;
import java.util.regex.Pattern;
public final class EmailHash
{
private static final Pattern VALID = Pattern.compile( "^[!-?A-~]+@[!-?A-~]+$" );
static String normalizeAndHash( final String email ) throws NoSuchAlgorithmException
{
final String trimmed = email.trim().toLowerCase();
if ( !VALID.matcher( trimmed ).matches() )
{
return "";
}
final int at = trimmed.indexOf( '@' );
final String domain = trimmed.substring( at + 1 );
String local = trimmed.substring( 0, at );
if ( domain.equals( "gmail.com" ) || domain.equals( "googlemail.com" ) )
{
local = local.split( "\\+", 2 )[0].replace( ".", "" );
if ( local.isEmpty() )
{
return "";
}
}
return HexFormat.of().formatHex( MessageDigest.getInstance( "SHA-256" )
.digest( ( local + "@" + domain ).getBytes( StandardCharsets.UTF_8 ) ) );
}
public static void main( final String[] args ) throws NoSuchAlgorithmException
{
System.out.println( normalizeAndHash( " J..A.NE+work.more+extra@GMAIL.COM " ) );
}
}
import { createHash } from "crypto";
function normalizeAndHash(email) {
const trimmed = email.replace(/^[ \t\n\r\f\v]+|[ \t\n\r\f\v]+$/g, "").toLowerCase();
if (!/^[!-?A-~]+@[!-?A-~]+$/.test(trimmed)) {
return "";
}
const at = trimmed.indexOf("@");
let local = trimmed.slice(0, at);
const domain = trimmed.slice(at + 1);
if (domain === "gmail.com" || domain === "googlemail.com") {
local = local.split("+")[0].replaceAll(".", "");
}
return local ? createHash("sha256").update(`${local}@${domain}`).digest("hex") : "";
}
console.log(normalizeAndHash(" J..A.NE+work.more+extra@GMAIL.COM "));
import java.security.MessageDigest
private val VALID = Regex("^[!-?A-~]+@[!-?A-~]+$")
fun normalizeAndHash(email: String): String {
val trimmed = email.trim(' ', '\t', '\n', '\r', '\u000B', '\u000C').lowercase()
if (!VALID.matches(trimmed)) return ""
val (rawLocal, domain) = trimmed.split('@')
val local = if (domain == "gmail.com" || domain == "googlemail.com") {
rawLocal.substringBefore('+').replace(".", "").ifEmpty { return "" }
} else rawLocal
return MessageDigest.getInstance("SHA-256")
.digest("$local@$domain".toByteArray())
.joinToString("") { "%02x".format(it) }
}
fun main() {
println(normalizeAndHash(" J..A.NE+work.more+extra@GMAIL.COM "))
}
import hashlib
import re
VALID = re.compile(r"^[!-?A-~]+@[!-?A-~]+$")
def normalize_and_hash(email):
email = email.strip(" \t\n\r\f\v").lower()
if not VALID.match(email):
return ""
local, _, domain = email.partition("@")
if domain in ("gmail.com", "googlemail.com"):
local = local.split("+", 1)[0].replace(".", "")
return hashlib.sha256(f"{local}@{domain}".encode()).hexdigest() if local else ""
print(normalize_and_hash(" J..A.NE+work.more+extra@GMAIL.COM "))
import CryptoKit
import Foundation
func normalizeAndHash(_ email: String) -> String {
let trimmed = email.trimmingCharacters(
in: CharacterSet(charactersIn: " \t\n\r\u{0b}\u{0c}")).lowercased()
guard trimmed.range(of: "^[!-?A-~]+@[!-?A-~]+$", options: .regularExpression) != nil
else { return "" }
let parts = trimmed.split(separator: "@")
let domain = String(parts[1])
var local = String(parts[0])
if domain == "gmail.com" || domain == "googlemail.com" {
local = local.prefix { $0 != "+" }.filter { $0 != "." }
}
guard !local.isEmpty else { return "" }
return SHA256.hash(data: Data("\(local)@\(domain)".utf8))
.map { String(format: "%02x", $0) }.joined()
}
print(normalizeAndHash(" J..A.NE+work.more+extra@GMAIL.COM "))
988b074286b20c503e3015c2076533f3bf4ce5ca6f8a507ab52c2e0f98d620b7
Your item may be in one of several thousand possible categories.
Set item_category_id to the ID number corresponding to your chosen category.
The following list contains the complete set of categories and their ID numbers (in parentheses):
The supported payment methods are:
| Name | Description |
|---|---|
credit_card | A saved or manually entered credit card |
deferred | A deferred payment, if you plan to collect payment later |
redeemable | A redeemable payment method, like a gift card or store credit |
payment_on_delivery | A payment that is collected on delivery |
wallet | An integrated wallet, like PayPal, Google Pay, Apple Pay, etc. |
other | Another type of payment not defined above |