With tracking codes in Oro application, you can learn how many users have visited your website from links within a specific marketing campaign and what these users’ actions on the site were.
When the tracking configuration is ready, create a Tracking Website record and add the code generated to the web-pages that you want to monitor.
Create a Tracking Website and Generate a Tracking Code¶
To generate a new website tracking code:
Navigate to Marketing > Tracking Websites in the main menu.
Click Create Tracking Website in the top right corner to get to the Create Campaign page.
In the General section, provide the following information:
Once you finish configuring the tracking website, click Save and Close in the top right corner of the page.
Manage Tracking Websites¶
You can manage tracking websites from the page of all tracking websites under Marketing > Tracking Websites.
When you hover over the more options menu (ellipsis menu) at the end of the row of a tracking website in the table, you can perform the following actions to it:
The tracking process also depends on the Tracking Settings defined for the OroCRM instance.
View Tracking Website Details¶
To view the website tracking details:
- Navigate to Marketing > Tracking Website in the main menu.
- Click on the Tracking Website item to preview its contents.
Here you can:
Preview the general website tracking details (including the identifier and the URL).
Get the tracking code that may be incorporated into the website page to track the campaign-related user activities.
The tracking code comes with the following instructions on basic use and customization:
Make sure this code is on every page of your website before the </body> tag. To track custom events, please uncomment the trackEvent string and replace [name], [value], and [user_identifier] parameters with your values. The script will log an event with the [name] name and optional [value].
Review the tracking results in the Events section.
Using the Tracking Code¶
Tracking code generated in the Tracking Website shall be added before the </body> tag on every page of the website you would like to monitor.
The code defines some of piwik-specific settings that should not be changed.
The following variables may be amended:
_paq.push(['setUserId', [user_identifier] ])
[user_identifier] defines the user id used in compliance with the website settings.
_paq.push(['trackEvent', 'OroCRM', 'Tracking', [name], [value] ]
If you want to track user activities on a specific page of the Website, uncomment this line and replace the “[name]” and “[value]” with the event name (string) and value (number) you would like to see in the Events report in Oro application (e.g. for a cart, event name may be cart_created, and the value may store the item code or cost).
The code may be filled with both static and dynamic values. However, the use of dynamic values requires complex back-end development.
Tracked Website Example¶
This is the code pre-implemented for an average website:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Every time a user gets to the page where this code is embedded, a visit event appears in the Website Tracking details with the corresponding value.
Visitors are treated as guests unless they sign in. As soon as the visitor signs in, their identification is logged in the visitor-id field. A special block has been implemented to enable transfer of the ID data to Oro application.
On some of the website pages, user activities may be logged in more details. For example, on the shopping list or shopping cart page, the following tracking script may be used:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Every time a visitor gets to the website page where the code is embedded, a Cart item added event appears in the Website Tracking details.
A similar tracking script may be placed on any Website pages. For example, on the checkout page you may enable the following actions:
_paq.push(['trackEvent', 'OroCRM', 'Tracking', 'order submitted', '2699.990000' ]);
An order submitted and the total cost of the order is logged.
Assign a Tracking Website in a Marketing Campaign¶
To include one or several Tracking Website(s) to a marketing campaign, use one of the following methods:
- Add a marketing campaign code to the tracking script provided in the Tracking Code section of the from the Website Tracking details (put it after the setUserId call). Each time a user reaches a page with such a code, an event will be logged within the campaign.
- Add marketing campaign code to the url and use this modified URL as a target in the links that lead to the website page. Use these modified URL in mailing, advert, landing pages etc. Each time a user reaches a page using the modified url, an event is logged within the campaign.
Collect Website Statistics¶
A list of events on the tracking website page helps you monitor every occurrence of the tracked action (e.g. a user has accessed a pre-defined part of the website following the campaign). You can find event name and value, user id (guest or user email), the url of the visited page, the code of the marketing campaign and time when the event was logged.
In the example above you can see the three kinds of events defined for the Jack and Johnson E-commerce website tracking. As soon as a user gets on any of the website pages, a visit event is logged with the 1 value. As soon as a user gets to the Orders page of the website, an Order event is logged, with the value that stores an ordered item id. As soon as a user gets to the Item Details page of the website, an View item event is logged with a value that stores a viewed item id.
To make sure that synchronization between your website and the application is successful, you may need to enable dynamic website tracking. For this, navigate to System > Configuration > General Setup > Tracking, and select the Enable Dynamic Tracking check box.
Related Topics on Marketing Automation