<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>MaxTraffic integration for SPA: Published Ordered Knowledge Base: : | MaxTraffic Knowledge Base</title>
    <description>Published Ordered Knowledge Base: MaxTraffic integration for SPA</description>
    <generator>Helprace RSS</generator>
    <link>https://help.maxtraffic.com/s1-general/knowledgebase/default/c9-maxtraffic-integration-for-spa?format=rss</link>
    <item>
      <title>How to integrate MaxTraffic in SPA (single-page application)?</title>
      <description><![CDATA[<p>To be able to use MaxTraffic with your SPA website you will have to insert three JavaScript codes on your website:</p>
<p>1. Tracking code: it allows us to track your visitor behavior and show them messages. Place our Tracking code across all pages of your website.</p>
<p>2. Conversion code: this script allows us to track conversions. Place our Conversion code on the "Thank you" page where the visitor will be taken after successfully completing a purchase.</p>
<p>3. SPA specific code: this code is used only for websites using SPA technology. You need to execute it each time a visitor clicks on a link inside[_cuted_]</p>]]></description>
      <pubDate>Fri, 16 Aug 2019 12:14:44 +0000</pubDate>
      <link>https://help.maxtraffic.com/i95-how-to-integrate-maxtraffic-in-spa-single-page-application</link>
      <guid>https://help.maxtraffic.com/i95-how-to-integrate-maxtraffic-in-spa-single-page-application</guid>
      <author>Chris</author>
      <dc:creator>Chris</dc:creator>
      <content:encoded><![CDATA[<p>To be able to use MaxTraffic with your SPA website you will have to insert three JavaScript codes on your website:</p>
<p><b>1. Tracking code</b>: it allows us to track your visitor behavior and show them messages. Place our Tracking code <span style="text-decoration: underline;">across all pages of your website</span>.</p>
<p><b>2. Conversion code</b>: this script allows us to track conversions. Place our Conversion code on the <span style="text-decoration: underline;">"Thank you" page</span> where the visitor will be taken after successfully completing a purchase.</p>
<p><b>3. SPA specific code</b>: this code is used only for websites using SPA technology. You need to execute it each time a visitor clicks on a link inside your single-page application. </p>
<h2>Where do I get the MaxTraffic tracking and conversion codes?</h2>
<p>1. Login into your account in <a href="https://e.maxtraffic.com" target="_blank">e.maxtraffic.com</a> using the email and password that was sent to your email.</p>
<p>2. Go to <a href="https://e.maxtraffic.com/#/account-settings/websites" target="_blank">Settings &gt; Websites</a></p>
<p><img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/74/media/settinsg_websites.jpg" alt=""></p>
<p>3. Click on <b>"Get Instructions"</b> button </p>
<p><img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/78/media/get_instructions2.png" alt="" width="700"></p>
<p>4. Now you will see the tracking code that you can send to the person, who is responsible for adding it into the website.</p>
<p><img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/78/media/tracking_code.png" alt="" width="700"></p>
<p>5. For Push Notifications you will have to download a file by pressing on <b>"Download File"</b> button
<br>
<img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/78/media/push_code.png" alt="" width="700"></p>
<p>6. At the step 3 <b>"Install Conversion Code"</b> to get the code for Thank you page as well:</p>
<p><img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/78/media/conversion_code.png" alt="" width="700"></p>
<h2>How to pass the conversion ID and conversion amount data to MaxTraffic?</h2>
<p>Place our Conversion code on the page that the visitors will be directed to, once they have successfully completed the action that you intended them to complete. Usually, this is a "Thank you" page after completed purchase.</p>
<p>Notice that this script has two variables that you should pass to MaxTraffic.
<br>
In "<b>conversion_id</b>" pass unique ID. Usually, this is the order or purchase ID.
<br>
In "<b>conversion_amount</b>" pass the total value of conversion without any currency symbols.</p>
<p><img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/20/media/conv_code.png" alt="" width="700"></p>
<h2>How to simulate a pageview in SPA (single-page application)? </h2>
<p>If your website is based on SPA (single-page application) you also need to execute an additional JavaScript code each time a visitor clicks a link in your application:</p>
<pre class="language-javascript"><code>&lt;script&gt;
mt('pageview');
&lt;/script&gt;</code></pre>
<p>This code will let MaxTraffic platform know that a new pageview just happened, and you will be able to properly use URL targeting and other MaxTraffic features. </p>]]></content:encoded>
    </item>
    <item>
      <title>Advanced visitor segmentation for Overlays, Promo Bars in SPA</title>
      <description><![CDATA[<p>Sometimes you have specific information about your visitors. That can be used for ad targeting if you can pass this data on to the MaxTraffic platform. </p>
<p>With a tiny JavaScript snippet, you can give us the information about your visitor, for example: - Visitor has products in his shopping cart - Cart total amount is below 50€ (maybe you have a free shipping for larger orders) - Visitor has logged in - Visitor is a female / male - Visitor has not signed up for your newsletter - Visitor is in a specific application step You can define one segment:</p>
<p>Or also[_cuted_]</p>]]></description>
      <pubDate>Mon, 20 Jan 2020 08:38:03 +0000</pubDate>
      <link>https://help.maxtraffic.com/i75-advanced-visitor-segmentation-for-overlays-promo-bars-in-spa</link>
      <guid>https://help.maxtraffic.com/i75-advanced-visitor-segmentation-for-overlays-promo-bars-in-spa</guid>
      <author>Chris</author>
      <dc:creator>Chris</dc:creator>
      <content:encoded><![CDATA[<p>Sometimes you have specific information about your visitors. That can be used for ad targeting if you can pass this data on to the MaxTraffic platform. </p>
<p>With a tiny JavaScript snippet, you can give us the information about your visitor, for example:
<br>
<span class="orange">-</span> Visitor has products in his shopping cart
<br>
<span class="orange">-</span> Cart total amount is below 50€ (maybe you have a free shipping for larger orders)
<br>
<span class="orange">-</span> Visitor has logged in
<br>
<span class="orange">-</span> Visitor is a female / male
<br>
<span class="orange">-</span> Visitor has not signed up for your newsletter
<br>
- Visitor is in a specific application step
<br>
<br>
You can define one segment:</p>
<pre class="language-javascript"><code>&lt;script&gt;
//define segments
mt('segments', ['signup step1']);

//execute pageview event (must have for SPA page)
mt('pageview');
&lt;/script&gt;</code></pre>
<p>Or also several segments at once, if needed:</p>
<pre class="language-javascript"><code>&lt;script&gt;
//define segments
mt('segments', ['application form', 'signup step2']);

//execute pageview event (must have for SPA page)
mt('pageview');
&lt;/script&gt;</code></pre>
<p><br>
As a result of giving this information to our platform, you will see new additional targeting options on the third step of campaign creation process.</p>
<p><img src="//s3.amazonaws.com/chd-data/data/maxtraffic/items/75/media/adv_segm.jpg" alt="" data-file="___chdfid_12077___"></p>
<p><b>Important:</b> these segments will be available only in current page. When visitor moves to a different page, if this next page has no segments defined - then the previous applied segment will no longer be available.</p>
<p>If you want to have a segment that is active on all website (in all pages), make sure - that this custom segment code is used also in all pages.</p>
<h2>How to simulate a pageview in SPA (single-page application)? </h2>
<p>If your website is based on SPA (single-page application), then remember - even if in a specific page you don't have any segments defined, you would still need to execute following code each time a visitor clicks a link in your application:</p>
<pre class="language-javascript"><code>&lt;script&gt;
mt('pageview');
&lt;/script&gt;</code></pre>
<p>This code will let MaxTraffic platform know that a new pageview just happened, and you will be able to properly use URL targeting and other MaxTraffic features. </p>]]></content:encoded>
    </item>
  </channel>
</rss>
