At a Glance: Learn how to configure Apptrove’s Smart Script to detect when users visit your website and seamlessly direct them to download or open the app, ensuring accurate attribution and deep linking.
Introduction
Apptrove’s Smart Script bridges your website and app store journeys, ensuring visitors who land on your pages convert into app users with proper attribution. It dynamically generates the correct app download URL, complete with campaign and ad metadata, so installs and events are correctly tied back to the original web source. Ideal for campaigns that begin on browsers and end within the app.
Why Use Smart Script?
Ensures accurate web-to-app attribution, reducing misattribution as organic installs.
Enables deep linking, allowing users to land in-app on the content they viewed on the web.
Automatically maps tracking parameters from incoming URLs to outgoing app links.
Choose the Right Setup for You
Apptrove supports two Smart Script options:
Script-Based Setup
Embed the Smart Script directly or via your tag manager (e.g., GTM). It dynamically builds download links with relevant metadata.
Banner-Based Setup
Display dynamic banners with CTAs that link to download pages, while still maintaining attribution mapping. This can run alongside the Script.
How to Create Smart Scripts?
You can find the Web-to-App option under the Engagement section in your Dashboard sidebar.
To create a Smart Script in Apptrove:
Name Your Smart Script
Provide a clear name.
Choose a Unilink Template:
Select the appropriate Unilink template based on the desired script behaviour. For more information on Unilink Templates, refer to our article here.
Map URL Parameters:
Define mappings for outgoing URL parameters using incoming URL parameters, default values, or override settings.
You can add multiple parameters as per your requirements using the Add Parameter button
Example Mapping:
Mapping parameter: Media Source
Outgoing URL parameter: pid
Incoming URL parameter: {source}
Default Values: Default values ensure that a parameter in the outgoing URL always has a fallback value in case the incoming URL does not provide it. This prevents broken links or missing attribution data when expected parameters are absent.
Use Case: If the incoming URL does not contain the
pid
parameter (which usually represents the partner ID), you can specify a default value like "partner0". This ensures the outgoing link will still includepid=partner0
, maintaining tracking continuity even when the original click lacked thepid
parameter.
Override values: You can override the incoming values according to your needs. For example, if traffic arrives with the value "2" in the incoming URL, the system will replace it dynamically in the outgoing URL with "Partner 2" to direct or attribute the traffic differently based on this mapped logic.
Web Referrer Mapping:
The Web Referrer Mapping feature allows you to capture the source URL that directed the user to your webpage and pass this information to the outgoing URL as a parameter. This is particularly useful for understanding and tracking the original referrer or source of the web traffic, even if it came from non-campaign sources like organic search or direct visits.
Use Case: Suppose you want to track whether a user arrived on your landing page from Google or another referring site. By mapping the web referrer, the system can automatically capture this source and pass it as the value of the outgoing URL parameter (e.g.,
at_channel
). This allows you to understand the origin of the traffic in your app attribution data.
Select How to Implement the Script:
Option 1: Embed directly into your website.
If you choose to embed the Smart Script directly into your website, you’ll need to coordinate with your web development team to ensure correct placement and execution. This option allows the Smart Script to dynamically adjust and generate outgoing URLs based on the URL parameter mappings you set within Apptrove. This approach is ideal for custom scenarios where GTM is not used, providing full control over script behaviour within the website code.
Next steps to embed the script in your website:
Generate the script and send it to your web developer to implement.
Instruct the developer on the required handling of the generated outgoing URL.
Option 2: Configure via Google Tag Manager (GTM)
In Google Tag Manager, create a new tag and select Custom HTML.Paste the generated Smart Script code into the HTML box.
Create a trigger (e.g., All Page Views) and associate it with the tag.
Click Save.
Testing the Smart Script Setup
Apptrove offers a testing tool to simulate and validate your Smart Script implementation.
Steps to Test:
Paste the generated script from Apptrove into the script field.
Provide an incoming URL as per your test scenario.
Click on Run Code.
The tool will display the outgoing URL generated based on your URL mapping.
Validation & Best Practices
Before you proceed with testing and deploying the Smart Script, it's important to validate the setup to ensure seamless functionality and accurate attribution tracking. Following best practices helps avoid common errors and ensures that the Smart Script performs as intended across all web pages where it is implemented.
Ensure the script is loaded on all relevant pages to avoid attribution breakage.
Utilise the testing tool before going live.
Coordinate between your marketing and tech teams for precise parameter mappings.
We are delighted to have assembled a world-class team of experienced professionals who are ready to take care of your queries and answer any questions you may have.
Feel free to reach out to us at any time by emailing us at support@apptrove.com or by using the in-platform chat feature. We'd love to hear from you!