Multiple domain tracking with program groups

If you own multiple domains we have some good news for you: You do not need to create multiple Tapfiliate accounts to manage your separate domains - instead, Tapfiliate offers you the option to track multiple domains within one account. This can easily be done through the Program Groups feature.

1. Create a Program Group

From your dashboard click Programs > Groups > New program group

On the next page you will find a form that has two fields:
* Title: This can be anything that helps you recognize the program group. If you are using program groups to set up multiple domains, the domain name would be an excellent choice. E.g. your-site.com
* Identifier: We will need this identifier in step 3 of this guide. You can pick something short. E.g. your-site.

Configuring Program Groups 01
Configuring Program Groups 02

Fill those out and hit save.

2. Assign a Program to a Group

This is a necessary step after creating a program. Otherwise, the group you have created won’t be good for anything.

To do this you simply go to programs > Click the settings button on the program which you want to select a group for > Groups > Celect the desired group from drop-down menu > Hit save.

Configuring Program Groups 03
Configuring programgroups 04
Configuring Programgroups 05

3. Modify your Tracking Code

To use one Tapfiliate account with multiple domains you will need to add the respective program group identifier to your tracking code:

  tap('conversion', 'your unique conversion Id', your conversion amount, { program_group: 'yourprogramgroupidentifier' });

Do keep in mind that you can’t just copy and paste this code directly: You should replace yourprogramgroupidentifier with the identifier that you have chosen when you created the group on the platform (steps above).

You should also replace 'conversion', 'your unique conversion Id' and your conversion amount with the information that is unique to your shopping cart/system and Tapfiliate account.

Protip: The external ID must be unique for every conversion. If you’re setting up multiple programs, say to track orders in multiple stores, and your external IDs are order numbers, these could very quickly start to clash. For this reason, we always recommend prefixing the external ID to avoid this from ever happening, as orders with the same external ID will not be tracked.

The next section will explain exactly how you will combine the existing conversion page code with your unique program group identifier.

Merging your Tracking Code with your Shopping Cart Integration

This code will look different depending on which shopping cart solutions you’re using. Below a few examples for some of the most used shopping carts:

Squarespace

Before:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', 'YOUR-ACCOUNT-ID');
    tap('conversion', '{orderId}', {orderSubtotal});
</script>

After:

<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', 'YOUR-ACCOUNT-ID');
    tap('conversion', '{orderId}', {orderSubtotal}, {'program_group': 'yourprogramgroupidentifier'});
</script>

Shopify

Before:

{% if first_time_accessed %}
<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', 'YOUR-ACCOUNT-ID');
    tap('conversion', '{{ order_number }}', {{ subtotal_price | money_without_currency | replace: ',', '.' }}, {
        discounts: {{ order.discounts | map: 'code' | json }}
    });
</script>
{% endif %} 

After:

{% if first_time_accessed %}
<script src="https://script.tapfiliate.com/tapfiliate.js" type="text/javascript" async></script>
<script type="text/javascript">
    (function(t,a,p){t.TapfiliateObject=a;t[a]=t[a]||function(){
    (t[a].q=t[a].q||[]).push(arguments)}})(window,'tap');

    tap('create', 'YOUR-ACCOUNT-ID');
    tap('conversion', '{{ order_number }}', {{ subtotal_price | money_without_currency | replace: ',', '.' }}, {'program_group': 'yourprogramgroupidentifier'}, {
        discounts: {{ order.discounts | map: 'code' | json }}
    });
</script>