Git Product home page Git Product logo

activecampaign-utm-subscription-source's Introduction

Synopsis

Version 0.4

This is a simple JavaScript plugin for ActiveCampaign users that want to see a visitor's initial landing page or traffic source (UTM parameters) when a form is submitted.

Visit data are stored in a cookie when the visitor first arrives at the site. Then, hidden fields in the ActiveCampaign form are populated with the UTM values. When the form is submitted, those values are sent to ActiveCampaign and stored in custom fields.

If no UTM parameters are included in the URL, then the script will consider referrals from Google, Yahoo, Bing, DuckDuckGo, or Baidu as organic traffic.

Referrals from other domains will be counted as normal referral traffic and the source will be set to wherever the visitor came from.

Direct traffic will default all UTM values to none.

Installation and Setup

  1. Create custom hidden fields in ActiveCampaign:

To track the initial landing page:

  • initial landing page

To track the UTMs:

  • utm medium
  • utm source
  • utm campaign
  • utm content
  • utm term
  1. Update your list subscription form by adding the hidden fields to the bottom of your site forms.

  2. If you use the Full Embed option for embedding your form, you will have to update the form code on your website. If you use the Simple Embed method, then no change to your form code is necessary.

  3. Upload the ac-utm-cookie.js and/or ac-initial-lp.js files to your server and add it betwween the <head> tags of your site: <script type="text/javascript" src="/ac-utm-cookie.js"></script>

Testing

Test it out by visiting your site with test UTM parameters (example.com/?utm_source=test-source&utm_medium=test-medium&utm_term=the-term&utm_content=some-content&utm_campaign=the_big_campaign).

Visit a few pages, then subscribe to your list with a test email. Check the new contact record that was just created and confirm that the UTM and/or initial landing page fields were populated correctly.

Help with implementation

  • The scripts are separated for the two different use cases but you can combine them if you want (requires a bit of JS noodling).
  • If you're using SquareSpace, you can uncomment the mercury:load line at the top. This will force SquareSpace to load the script on every page load.
  • Want help or a custom implementation? You can contact me via my website (listed on my GitHub profile page.)

License

Distributed under the MIT license.

activecampaign-utm-subscription-source's People

Contributors

sirbots avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

activecampaign-utm-subscription-source's Issues

Google Ads - GCLID

Google Ads appends GCLID as the parameter instead of UTM parameters. Is there a way to update the code so that it uses the data within the GCLID for the UTM parameters?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.