You are currently viewing Stop Sifting! Find Contact Tag Dates in ActiveCampaign with R
Find Contact Tag Dates in ActiveCampaign with R

Stop Sifting! Find Contact Tag Dates in ActiveCampaign with R

Have you ever been frustrated by the lack of date information for tags on ActiveCampaign contact pages? When troubleshooting automations, knowing when a tag was applied is crucial. Sifting through a long list of tags, especially for clients with extensive tagging, can be a real time-suck.

There’s a better way! Here, I’ll introduce the R package ‘ractivecampaign’ that simplifies finding the date a tag was applied to a contact.

ActiveCampaign Contact Page with Tags

The Problem:

ActiveCampaign’s interface displays contact tags without timestamps. This makes it difficult to:

  • Diagnose why automations aren’t triggering as expected.
  • Understand a contact’s journey through your marketing funnel.

 

The Manual (and Tedious) Solution:

Previously, I relied on the ActiveCampaign API to retrieve contact tags. This involved:

  1. Making multiple API calls.
  2. Matching retrieved tag IDs to a separate list of tag names.

The Powerful (and Time-Saving) Solution:

The R package ‘ractivecampaign’ by Alexey Seleznev is a game-changer. It allows you to easily query a client’s ActiveCampaign account and retrieve a list of tags assigned to a contact, including:

  • Tag ID
  • Tag Name
  • Date Assigned

This streamlined process significantly reduces troubleshooting time and provides valuable insights into your marketing automation efforts.

The R Code

				
					library(ractivecampaign)
library(dplyr)

# Enter ActiveCampaign API token below
Sys.setenv('ACTIVECAMPAGN_API_TOKEN' = "")

# Enter ActiveCampaign API URL below
Sys.setenv('ACTIVECAMPAGN_API_URL' = "")

# Replace 1000 below with the contact’s id.
contact_id <- 1000

# The next line retrieves all the tags for the given contact id
contact_tags <- ac_get_contact_tags(contact_id) 

# Retrieve all tag data in the ActiveCampaign account
all_tags <- ac_get_tags()

# Merge the contact tags with all the tag data to produce a tag list 
# for the given contact with dates assigned to the contact
contact_tag_details <- merge(contact_tags, all_tags, by="id", "tag") %>%
  select(contains(c('contact','tag','tag.y','cdate.x')))

# Display the list
View(contact_tag_details)

				
			

Summary

Even if you’re not an R expert, the ‘ractivecampaign’ package can be a valuable tool.

I have found this script essential for troubleshooting issues with automations that are triggered by tags or automations that assign multiple tags.

Loom logo lockup white

Join 14 million global users

If your time is being eaten up by endless meetings, chats and email strings, give Loom a try so that you can free up your day to get real work done during traditional work hours.

Leave a Reply