In today's digital marketing landscape, understanding how different channels contribute to your conversions is essential. Amplitude provides powerful tools to track and analyze attribution across multiple channels. This step-by-step tutorial will guide you through setting up Amplitude attribution for your multi-channel campaigns.

Prerequisites

  • An active Amplitude account
  • Access to your website or app's codebase
  • Basic knowledge of JavaScript
  • Configured marketing channels (email, social media, paid ads, etc.)

Step 1: Integrate Amplitude SDK

Begin by integrating the Amplitude SDK into your website or app. For web applications, include the JavaScript SDK:

Insert the following script in your HTML <head> section:

<script>

amplitude.getInstance().init("YOUR_API_KEY");

</script>

Step 2: Define Campaign Source Parameters

Use UTM parameters in your campaign URLs to identify traffic sources. Example URL:

https://www.yoursite.com?utm_source=facebook&utm_medium=social&utm_campaign=spring_sale

Ensure your website captures these parameters on page load:

Example JavaScript to capture UTM parameters:

function getUTMParameters() {

const params = new URLSearchParams(window.location.search);

return {

source: params.get('utm_source'),

medium: params.get('utm_medium'),

campaign: params.get('utm_campaign')

};

}

Step 3: Track Campaign Data

Send the UTM parameters to Amplitude as user properties or event properties when a user interacts with your site:

Example JavaScript to track an event with attribution data:

const utmData = getUTMParameters();

amplitude.getInstance().logEvent('Page Viewed', {

page: document.title,

source: utmData.source,

medium: utmData.medium,

campaign: utmData.campaign

});

Step 4: Create Attribution Reports

Use Amplitude's analytics tools to create custom reports that attribute conversions to different channels. Filter by UTM parameters to analyze the performance of each campaign.

Best Practices

  • Consistently use UTM parameters across all campaigns.
  • Capture UTM data on every page load.
  • Combine Amplitude data with other analytics tools for comprehensive insights.
  • Regularly review attribution reports to optimize campaigns.

By following these steps, you can effectively track and analyze the contribution of each marketing channel to your overall campaign success. Proper attribution helps you allocate your marketing budget more efficiently and improve your future strategies.