Integrating the myTarget advertising account with Bitrix24

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1177
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

myTarget Campaign Cabinet Integration with Bitrix24

A marketer runs campaigns in myTarget, collects leads through forms, and exports them from the cabinet once a day, manually entering them into CRM. By that time, some leads have cooled, others are lost in handoffs between colleagues. Campaign expenses are calculated in a separate spreadsheet, and the connection "click → lead → deal → payment" exists only in the marketer's head. Integrating myTarget with B24 closes the loop: leads enter CRM automatically, expenses are imported, and audiences are updated from CRM segments.

myTarget Lead Forms and Automatic Import

myTarget allows creation of lead forms (Lead Ads)—users leave applications in the Odnoklassniki feed or on Mail.ru properties without navigating to an external site. Form data is stored in the myTarget cabinet and accessible through API.

Integration works through myTarget API v2:

  1. A user completes a lead form on the myTarget platform.
  2. B24 periodically polls the myTarget API (or receives a webhook if configured) and retrieves new applications.
  3. For each application, a lead is created in CRM with populated fields: name, phone, email, data from custom form fields.
  4. A responsible manager is assigned, first-stage automation triggers.

Server-side integration is used—the application authorizes in myTarget through OAuth 2.0, obtains an access token, and requests data through GET /api/v2/lead_ads/vk_forms.json.

Form Field Mapping

myTarget lead form fields must be mapped to B24 CRM fields. Typical mapping:

myTarget Field B24 CRM Field Note
first_name Contact Name Automatic
phone Phone Automatic
email Email Automatic
city City (custom field) Requires field creation in CRM
Custom Field UF_CRM_* Manual mapping setup

If the myTarget form contains hidden fields with UTM tags—they are transmitted to the lead and populate standard fields UTM_SOURCE, UTM_MEDIUM, UTM_CAMPAIGN.

Audience Export from CRM to myTarget

myTarget accepts audiences for targeting through Audiences → User Lists. Data is uploaded as phone and email hashes. B24 allows forming such lists from CRM segments.

Typical scenarios:

  • Lookalike by buyers. Segment "Deals with 'Successfully Closed' status in the last 12 months" → hash export → myTarget builds a similar audience.
  • Retargeting warm leads. Segment "Leads with 'In Progress' status, no activity for 7 days" → retargeting ads on Mail.ru and OK platforms.
  • Exclude clients. Segment of current clients → exclude from acquisition campaigns.

Export is implemented through CRM Marketing → Audiences in B24. Data is hashed (SHA-256) before transmission—only hashes go to myTarget, not raw data.

For automatic audience updates, regular synchronization is configured: when a segment changes in CRM, new contacts are added to the myTarget audience, removed ones are excluded.

Expense Import from myTarget

myTarget API provides campaign statistics through GET /api/v2/statistics/campaigns/day.json. B24 retrieves:

  • Daily expenses by campaigns and ads
  • Impressions, clicks, CTR, CPC
  • Conversion data (if tracking is configured)

In B24 end-to-end analytics, myTarget expenses are matched with leads and deals by UTM tags. The report shows the complete picture: campaign spend → number of leads → deal conversion → revenue → ROI.

For correct attribution, all links in myTarget ads must contain UTM tags. Recommended format: utm_source=mytarget&utm_medium=cpc&utm_campaign={campaign_id}. myTarget macros ({campaign_id}, {banner_id}) automatically substitute campaign and ad IDs.

Conversion Tracking

myTarget supports offline conversions—transmission of events from CRM back to the ad cabinet. This allows optimization by actual sales, not clicks.

Scheme:

  1. A counter is created in myTarget and a conversion goal is configured.
  2. When a deal closes in B24, a robot at the "Successfully Closed" stage sends a conversion event through myTarget API (POST /api/v2/remarketing/conversions.json).
  3. myTarget matches the conversion with the click by user_id or contact data hash.
  4. myTarget algorithms begin optimizing ad delivery to an audience more likely to make a purchase.

To transmit conversions, click_id binding is required (transmitted via GET parameter when clicking the ad) and CRM event. Click_id is saved in a custom lead field upon creation, then used when sending conversion.

myTarget vs. VK Ads Differences

myTarget and VK Ads are different ad platforms (though both belong to VK). APIs differ, data formats differ, audiences overlap partially. If running ads on both platforms—two separate integrations are needed. In B24 end-to-end analytics, they appear as different sources.

What We Configure

  • Connecting the myTarget cabinet to B24 through OAuth 2.0 and synchronization setup
  • Automatic lead import from myTarget lead forms into CRM
  • Form field mapping to CRM fields, creating missing custom fields
  • Setting up audience export from CRM segments to myTarget
  • Expense import and end-to-end analytics connection
  • Campaign tagging with UTM tags using myTarget macros
  • Configuring offline conversion transmission from CRM to myTarget
  • Testing complete chain: click → lead form → lead in CRM → UTM → expenses → conversion