Which events you must trigger depends on your website type. See the relevant section based on your website’s objective:
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 |
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 | recommended | 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 | false | 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 has 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. You should only pass these data after you receive consent from the user.
| Name | Type | Required | Description |
|---|---|---|---|
email | string | false | The email of this user, for example “jdoe@example.com”. email must be lowercase. The pixel will hash it for you. |
phone | string | false | 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 | false | The unique identifier for the customer. This should be at least six characters. |
Axon hashes plaintext email addresses and phone numbers that you provide.
If you would prefer to perform your own hashing, do so by carefully following these guidelines:
emailphone1 for United States phone numbers).
Then hash via SHA256.
For example (for email addresses):
#include <iostream>
#include <string>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <openssl/sha.h>
std::string normalizeAndHash(const std::string& email){
std::string normalized = email;
normalized.erase(0, normalized.find_first_not_of(" \t\n\r"));
normalized.erase(normalized.find_last_not_of(" \t\n\r") + 1);
std::transform(normalized.begin(), normalized.end(), normalized.begin(), ::tolower);
unsigned char hash[SHA256_DIGEST_LENGTH];
SHA256((unsigned char*)normalized.c_str(), normalized.size(), hash);
std::ostringstream oss;
for (int i = 0; i < SHA256_DIGEST_LENGTH; ++i)
oss << std::hex << std::setw(2) << std::setfill('0') << (int)hash[i];
return oss.str();
}
int main(){
std::cout << normalizeAndHash(" John_Smith@gmail.com") << std::endl;
}using System;
using System.Text;
using System.Security.Cryptography;
class Program {
static string NormalizeAndHash(string email) {
string normalized = email.Trim().ToLower();
using (SHA256 sha256 = SHA256.Create()) {
byte[] bytes = sha256.ComputeHash(Encoding.UTF8.GetBytes(normalized));
StringBuilder sb = new StringBuilder();
foreach (byte b in bytes)
sb.Append(b.ToString("x2"));
return sb.ToString();
}
}
static void Main() {
Console.WriteLine(NormalizeAndHash(" John_Smith@gmail.com"));
}
}import java.security.MessageDigest;
import java.nio.charset.StandardCharsets;
public class HashEmail {
public static String normalizeAndHash(String email) throws Exception {
String normalized = email.trim().toLowerCase();
MessageDigest digest = MessageDigest.getInstance("SHA-256");
byte[] hash = digest.digest(normalized.getBytes(StandardCharsets.UTF_8));
StringBuilder hex = new StringBuilder();
for (byte b : hash) hex.append(String.format("%02x", b));
return hex.toString();
}
public static void main(String[] args) throws Exception {
System.out.println(normalizeAndHash(" John_Smith@gmail.com"));
}
}import { createHash } from "crypto";
function normalizeAndHash(email) {
const normalized = email.trim().toLowerCase();
return createHash("sha256").update(normalized).digest("hex");
}
// Example
console.log(normalizeAndHash(" John_Smith@gmail.com"));import java.security.MessageDigest
fun normalizeAndHash(email: String): String {
val normalized = email.trim().lowercase()
val bytes = MessageDigest.getInstance("SHA-256").digest(normalized.toByteArray())
return bytes.joinToString("") { "%02x".format(it) }
}
fun main() {
println(normalizeAndHash(" John_Smith@gmail.com"))
}import hashlib
def normalize_and_hash(email):
normalized = email.strip().lower()
return hashlib.sha256(normalized.encode()).hexdigest()
# Example
print(normalize_and_hash(" John_Smith@gmail.com"))import Foundation
import CryptoKit
func normalizeAndHash(_ email: String) -> String {
let normalized = email.trimmingCharacters(in: .whitespacesAndNewlines).lowercased()
let hash = SHA256.hash(data: normalized.data(using: .utf8)!)
return hash.map { String(format: "%02x", $0) }.joined()
}
print(normalizeAndHash(" John_Smith@gmail.com"))62a14e44f765419d10fea99367361a727c12365e2520f32218d505ed9aa0f62f
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 |