Cloudflare Integration for Dynamic Number Insertion (DNI)


This article guides you through integrating our call tracking solution with Cloudflare Workers to achieve Dynamic Number Insertion (DNI) on your website. Utilizing a server-side solution, this integration ensures efficient and seamless number of updates processed at the edge with minimal impact on client-side performance.

How it Works:
API Token Setup

  1. Enter an API Token in the field provided.
    Creating/accessing Cloudflare Worker API tokens: https://developers.cloudflare.com/fundamentals/api/get-started/create-token/

    The API token should be configured with the following permissions. unnamed.png
  2. Enter a Cloudflare Account ID in the field provided.

Cloudflare Worker Deployment - Deploy a Cloudflare Worker:

  1. Using the deploy button in the top right, a CTM worker will be created in your Cloudflare account.
  2. The worker manages dynamic number changes on your site.
  3. Visit the Cloudflare Workers documentation for more info on workers.

Site Targeting:
Define Site Routes for your new CTM worker in Cloudflare. This allows you to control which site has DNI enabled via Workers Routes within your Cloudflare account.
For example, if your website were aicallspot.com, you would create a route to cover the whole website.
In Cloudflare, you would have a rule: *aicallspot.com/*

unnamed (1).png


To set up a route in the Cloudflare dashboard:

  1. Log in to the Cloudflare dashboard ↗ and select your account.
  2. Go to Workers & Pages and select your CTM Worker in Overview.
  3. Go to Settings > Domains & Routes > Add > Route.
  4. Select the zone and enter the route pattern.
  5. Select Add route.

Google Analytics Integration:


Set Google Analytics (GA4) Measurement ID
When using Zaraz you will want to set the default measurement ID here. If you are using multiple sites from this single account, you can use worker routes to adjust these variables dynamically for your different domains. Read more at https://developers.cloudflare.com/zaraz/faq/

Benefits:

  1. Efficient Management: Handle dynamic content changes server-side, reducing client-side loading times.
  2. Seamless Updates: Process requests at the edge for optimal performance.

For further assistance, please refer to the Cloudflare Workers documentation or contact our support team.

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.