Articles on: Link Tracking & Events

An Overview of Event Tracking

Event Tracking is a highly flexible feature that allows you to collect data on a wide variety of contact behaviors. You can create an event for any activity on your website or app and assign it a value. As you begin to capture event data and send it to your Platformly account, you can use it to improve your marketing and sales processes as well as trigger automations, create segment conditions, and personalize campaigns.

For example, you can track video views, button clicks, orders, log-ins, in-app behaviors, and more. With Event Tracking, you will need to create a custom code for each event you would like to track on your website or app.


Event Tracking is an advanced feature: you will need to be familiar with a programming language to set it up on your website or app. If you don’t know any programming language, you should ask someone from your team to help you.

Important: In order to use Event Tracking, you will need to place your “Project Code” within your pages, where you want the events to be fired.


1. When are the events fired?



An event can be fired when we have information about “who” is firing that event.

Events can be fired by:

1.1 Unknown visitors who clicked on a tracking link
If you set up a Facebook ad campaign, or another type of campaign, you might want to learn more about the behavior of your visitors, even if they are not in your contacts list.

This option allows you to track this kind of visitors and fire events for them.

Later, if they join a contacts list in your Platformly account, we will match their past events and add them to the newly created contact.

1.2 Contacts who clicked a link in a broadcast or automated email
Anyone who receives an email from our system and clicks on a link (in this email) will fire an event on your page.

1.3 Contacts matched with an email address sent to us over an event_code
When we receive this information, we will match the email address of the contact who took the defined action and match it with the email address of the contact in your Platformly account. We will then add that event to the contact. If the contact does not exist in your Platformly account, the event will not be added.


2. How to create an event?



2.1 Navigate to “Tracking” -> “Events”




2.2 Create your event:

Select an event action (required)
Add an event description (required)
Assign additional options (optional)



2.3 Click on “Create Code”




3. How to add an event within your page?



Once your event has been created, it is time to add the code to your page.

3.1 Embed your “Project Code” where you want the event to fire

You can skip this step if you have already done it once.

If you are adding multiple events across your site, it is recommended to add this code in the header or footer so it shows on every page of your site.

The “__Add Emal Identifier__” option will add the extra code below within your project code, where you need to point the email of the contact firing this event (optional):

_ply.push([’email’, ‘{EMAIL ADDRESS}’]);

Replace** {EMAIL_ADDRESS}** with a real email address like “contact@email.com“. This should be done in a programming language in order to be dynamic and send us the right email address for every contact that visits your page.



Tip: If you are sending the email over an URL, the below code will automatically search for an "email" parameter and attach it to the tracking code.

You can adjust the parameter's name in "line 3" to a different if the default one is not used. On an existing code, you need to add the 3 lines on top of your code and then just change:

ply.push([’email’, ‘{EMAIL ADDRESS}’]) to ply.push(['email', email]);

<script type="text/javascript">

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
email = urlParams.get('email')

function plyt(t,e,p){"object"==typeof p&&(p=JSON.stringify(p)),"function"==typeof plyt_exec&&3==_ply.length?plyt_exec(t,e,p):setTimeout("plyt('"+t+"','"+e+"','"+p+"')",150)}var _ply=_ply||[];!function(){var t=("https:"==document.location.protocol?"https":"http")+"://www.platform.ly/";_ply.push(["cid",{company_id}]);_ply.push(["pid",{project_id}]);var e=document,p=e.createElement("script"),o=e.getElementsByTagName("script")[0];p.type="text/javascript",p.defer=!0,p.async=!0,p.src=t+"platformly.js",o.parentNode.insertBefore(p,o)}();

_ply.push(['email', email]);

</script>


If your event code has custom options you can send updated values by adding the options in the event code:

plyt('click', 'Test Click', {"event":"{EVENT_ID}", "{OPTION_1}":"{VALUE_1}", "{OPTION_2}":"{VALUE_2}"});

3.2 Mask out and White-Label the tracking code using your own Custom Domain

By adding a custom domain for tracking purposes, you can use it also to mask and white-label your tracking code, which will improve the performance of the tracking code in cases when ad-blockers are being used.



3.3 Choose the way you want to include your event and copy the code

There are 2 different ways to add the code:

Page: Standalone code that can be placed anywhere on a page
Link/Button: Inline code that can be used in link/button events, other JavaScript code…

Choose the desired code, click on “Copy Code” and then paste it in your page.




Watch a video on: How to Setup Events

Updated on: 25/05/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!