Learn how to implement offline conversion tracking to attribute them to optimizations.
Offline conversion tracking is super helpful if your customer journey doesn't end online. If you close deals over the phone, track signups in another system, or finish things in person, this feature helps make sure your data reflects the full picture. You can connect those “offline” actions back to what happened on your site — i.e., which of your optimizations led to real results.
How it all comes together
Once an Optimize site admin configures your Optimize site and your dev team has finished their backend configuration, offline conversions can be attributed to your optimizations. Here’s the big picture of how it will all work:
- A person visits your site
- The client-side API captures their user ID
- Later, the person converts offline (e.g., over the phone)
- You backend triggers the server-side API to send that conversion info to Optimize
- Optimize validates the data (e.g., valid authorization token, timestamps, etc.)
- Verified conversion data gets attributed to the optimizations the person viewed on your site
Note
Offline conversions import in nightly batches, so offline conversion may not be in the results until the following day.
Configuring your Optimize site
Part one of the configuration is to prepare your Optimize site for offline conversions tracking. These steps are meant to be completed in your Optimize site dashboard by an Optimize site admin.
Generate an authorization token
First, you'll need to create an authorization token. This token acts like a security pass to ensure only approved data is recorded. Your dev team will append the token to every server-side API request. Don’t share this token outside your organization.
Open your Optimize site in Webflow, then:
- Click Account settings in the Navigation panel
- Go to Offline conversions tracking authorization token
- Click Add
- Enter a name for the token
- Click Generate token
- Copy the token and send it to your dev team
Create a custom event
Events are how Optimize keeps track of conversions. You need to create custom events so that your devs can code their name apiName in to the server-side API requests. Create one custom event for each offline conversion type you want to track.
-
Create a custom goal event and enter a unique
apiName(e.g.,application-accepted) - Copy the
apiNameyou created for each event and send it to your dev team
Add custom goals to optimizations
Any optimization that can have an offline conversion will need to be updated so that its goal leverages the custom event(s) you created. This allows the offline conversion to be attributed to your optimizations.
- Edit an optimization
-
Add a custom goal
- Use the Select event dropdown to choose a custom event you created
- Click Set this as primary goal if you want to Optimize for these offline conversions
Configuration work for your dev team
Part two of the configuration is for your dev team to configure the backend systems to send offline conversions to Optimize.
Important
Every offline conversion tracking setup is different. Your exact configuration will depend on the tools you use and how your systems are integrated. Use the following info as foundational building blocks to get you started.
Developers, you'll need to leverage our client-side API to assign a user ID to each visitor and leverage our server-side API to gather and send conversion info from your "offline" systems to Optimize.
Before you get started, you'll need the following info to configure the APIs:
- The Optimize authorization token
- The Optimize custom event
apiName(s) - Your Optimize Account ID (from the site's Account Settings)
Additionally, if you're using third-party tools like Salesforce or Marketo, you may need to create triggers or logic to know when to send conversion events.
Once everything is configured, you can test functionality using a curl command.
Client-side API
setUserId() is exposed by the snippet in the browser. It tells Optimize who the visitor is by passing a user ID.
The value you use for the ID depends on the system where your user data lives (e.g., an in-house database, Salesforce, Marketo, etc.). If your IDs include Personally Identifiable Information, use a one-way hash and send the hashed value.
To attribute a conversion, the user ID for a visitor must be passed to Optimize before any related offline events are sent.
Syntax:
intellimize.setUserId( userDomain: string, userId: string ) => void;
Important
All API calls must be wrapped in a .ready() callback.
Example:
intellimize.ready(function() {
intellimize.setUserId("salesforce", "72349876");
});Server-side API
This server-side HTTP API communicates over HTTPS to send conversion events to Optimize.
HTTPS request format:
POST /event HTTP/1.1
Host: log.intellimize.co
Authorization: ApiKey ${apiKey}
{
customerId: string, // your Optimize account ID found in Account Settings
apiName: string, // API name for the Optimize custom event
userDomain: string, // e.g., "salesforce"
userId: string, // user ID tied to the domain
actionId: string, // unique ID for the conversion
actionTimestamp: number, // UTC time the converssion occurred in UNIX milliseconds
value?: number // optional monetary value
}Note
• customerId — your Optimize account ID
• ApiKey — is the Optimize site authorization token
• actionTimestamp — must be in UTC and formatted as UNIX time (in milliseconds)
HTTPS response format:
HTTP/1.1 200 OK
Example request:
POST /event HTTP/1.1
Host: log.intellimize.co
Authorization: ApiKey AbCdEf123456
{
customerId: "123456789",
apiName: "application-accepted",
userDomain: "salesforce",
userId: "72349876",
actionId: "23823940",
actionTimestamp: 1578316150000,
value: 149.99
}Test your configuration with curl
Once your setup is complete, use a curl command to test your server-side API integration. Learn more about curl.
- Verifies your Optimize authorization token is working
- Verifies your offline conversion data is being received correctly
Where to run the command:
- Mac: Open Terminal (Applications > Utilities > Terminal)
- Windows: Open Command Prompt (Start > Windows System > Command Prompt)
Run the following curl command with your real values (e.g., your actual account ID, apiName, etc.).
Note
This example is written for the MacOS. In UNIX systems, the backslash (\) is used to break long commands into multiple lines. On Windows, replace each backslash with a caret (^).
curl --location --request POST 'https://log.intellimize.co/event' \
--header 'Authorization: ApiKey ${apiKey}' \
--header 'Content-Type: application/json' \
--data-raw '{
customerId: "your-account-id",
apiName: "your-event-name",
userDomain: "your-user-domain",
userId: "user-id-from-client-side",
actionId: "unique-conversion-id",
actionTimestamp: 1653514258136,
value: 149.99
}'Example:
curl --location --request POST 'https://log.intellimize.co/event' \
--header 'Authorization: ApiKey AbCdEf123456' \
--header 'Content-Type: application/json' \
--data-raw '{
customerId: "123456789",
apiName: "application-accepted",
userDomain: "salesforce",
userId: "72349876",
actionId: "23823940",
actionTimestamp: 1578316150000,
value: 149.99
}'Note
If the request is successful, the command line will return the data you submitted.
Additional information
Formatting actionTimestamp correctly
The actionTimestamp field in server-side API calls must be in UTC and formatted as UNIX time in milliseconds.
Conversions may be ignored or attributed incorrectly when:
- The timestamp is in the wrong format
- The timestamp occurs after the server-side API call is made
- The timestamp is older than 7 days
What is UTC time?
UTC (Coordinated Universal Time) is a global time standard used to measure time consistently across different regions. If your timestamps are currently in local time — either your time zone or your server’s — they need to be converted to UTC.
What is UNIX time?
UNIX time counts the number of seconds since 00:00:00 UTC on January 1, 1970 (known as the UNIX Epoch). It’s a standardized format that doesn’t change based on location.
UNIX time is represented as a numeric string. For example, both lines below refer to the same moment in time:
- UTC time — May 25, 2022 21:30:58
- UNIX time — 1653514258136
Pro tip
You can use savvytime.com to check the time difference between your local time and UTC. Currentmillis.com lets you check your current time in UTC and UNIX, or convert from local to UNIX in milliseconds.
Variation attribution requirements
For an offline conversion to be attributed to a variation a visitor saw, the following two key conditions must be met.
The apiName must match at the time of the conversion
The apiName in the offline conversion must exactly match the apiName of an event that existed at the time the conversion occurred. Attribution will not happen if:
- The event was created after the conversion’s timestamp
- The event had a different
apiNamewhen the conversion happened, even if it was renamed later to match
The conversion must fall within the attribution window
- The view event (when the visitor saw the variation) must occur before the offline conversion’s timestamp
- The offline conversion must happen during the same session — either:
- Before the session expired due to 30 minutes of inactivity
- Or before the session hit the 24-hour maximum timeout
When offline conversions import
Client-side conversions are recorded in real time. Offline conversions, however, are imported in batches each night at midnight UTC. This means stats for the current day won’t yet include any new offline conversions.
Once the nightly batch import runs, the offline conversions will appear in your optimization results, timestamped according to when the conversions actually occurred. Because of this, data for previous date ranges may change from day to day as new conversions are imported and results are recalculated.
Example config for credit card signups
In this example, a visitor fills out a form on your website to apply for a credit card. However, the actual conversion — approval — happens later, after a review process.
This setup is similar to a typical client-side experience, but since the final conversion happens offline, you’ll need to configure both the client-side and server-side APIs to track it properly.
Example of setting the user ID with the client-side API:
Use the setUserId() call to pass the user’s identity to Webflow Optimize. Be sure to use an ID that’s available on both the client and server sides — e.g., an account ID or unique application ID.
intellimize.ready(function() {
intellimize.setUserId("applicationId", "123456789");
});Example of sending the goal event with the server-side API:
To report the offline conversion, send a POST request to the Webflow Optimize server-side API as shown below.
POST /customer/123456789/event
Host: log.intellimize.co
Authorization: ApiKey AbCdEf123456
{
eventName: "application-accepted",
userDomain: "applicationId",
userId: "123456789",
actionId: "23823940",
actionTimestamp: 1578316150,
value: 149.99
}