Tuesday, April 16, 2019

How to integrate wootric in ionic


Wootric integration with ionic 

There are two options to implement this -

Option 1 - Add below code after “build/main.js” Or add at the bottom of page.

<!-- start Wootric code -->
<script type="text/javascript" src="https://cdn.wootric.com/wootric-sdk.js"></script> 
<!-- end Wootric code -->


Now in your TS file (Where you want to trigger wootric survey) add below code -

/* Wootric code start */
 window['wootric_survey_immediately'] = true; // Comment out the line wootric_survey_immediately = true when you are ready for production. Alternatively, leave the line in the code for testing purposes or to survey the customer upon every visit to a specific page.
 window['wootricSettings'] = {
   email: (user.email)?user.email:'',
   created_at: Math.floor(Date.now() / 1000),
   account_token: "NPS-********”, // You need to update your account token here
   otherData: {
     city: user.city,
     role: user.role
   }
 };
// console.log('wootricSettings:', window['wootricSettings']);
//console.log('WootricSurvey');
window['WootricSurvey'].run("wootricSettings");
/* Wootric code end */


This will trigger wootric survey on the selected page.
Note - You need to update account token on “NPS-XXXXXXXX”

Here - user.email is user email id, otherData are additional data which you want to send on wootric.




Option 2 - You can also integrate into the ionic framework with the help of javascript code. To integrate this you just need to follow below steps -

Insert below javascript code in the bottom of your index.html file 

<!-- start Wootric code -->
<script type="text/javascript">
  window.wootric_survey_immediately = true; // Shows survey immediately for testing purposes. TODO: Comment out for production.
  window.wootricSettings = {
    email: 'customerEmail@example.com', // TODO: Required to uniquely identify a user. Email is recommended but this can be any unique identifier.
    //external_id: '123abc', // TODO: Reference field for external integrations only. Send it along with email. OPTIONAL
    created_at: 1234567890, // TODO: Date as a 10 digit Unix timestamp in seconds. OPTIONAL
    account_token: 'NPS-XXXXXXXX' // This is your unique account token.
  };
</script>
<script type="text/javascript" src="https://cdn.wootric.com/wootric-sdk.js"></script>
<script type="text/javascript">
  // This loads the Wootric survey
  window.wootric('run');
</script>
<!-- end Wootric code -->


This will trigger wootric survey when your all launch.  


You can check more about this on this URL (Reference URL) - https://engineering.wootric.com/testing-the-wootric-sdk-with-ionic-framework


If you have any questions you can post here in the comment section. Thanks, All the best.

14 comments:

  1. Thanks for your post! Really interesting blogs. Here is the some more interesting and most related links.

    Best digital marketing company in Dubai, United Arab Emirates. Brandstory is one of the top and best digital marketing companies in Dubai UAE. As a leading digital marketing agency in Dubai, We offer search engine optimization services, online marketing services, UI UX design services, search engine marketing services, email marketing services, Google / Facebook / Bing pay per click services, Internet marketing services, website design services and website development services, social media marketing services. Hire ROI based digital marketing services company in dubai to get digital leads for your business.

    Digital marketing company in Dubai | Digital Marketing Agency in Dubai | SEO Company in Dubai | SEO Agency in Dubai | Best Digital Marketing Companies in Dubai | Top Digital Marketing Agencies in Dubai | Best SEO Companies in Dubai | SEO Agencies in Dubai | Online Marketing Company in Dubai | SEO Services Company in Dubai | PPC Company in Dubai | PPC Agency in Dubai | | PPC Services in Dubai | Social Media Marketing Company in Dubai | Social Media Marketing Services in Dubai | Social Media Marketing Agencies in Dubai | Web Design Company in Dubai | Website Designers in Dubai | Website Development Services Company in Dubai | Web Design Companies in Dubai

    ReplyDelete
  2. I really enjoyed reading this blog. It was explained and structured with perfection; Best Digital Marketing Company in Delhi

    ReplyDelete
  3. hello every one nice blog. it is really an interesting article We are also providing some backlinks
    backlinks
    backlinks
    backlinks
    backlinks
    backlinks
    backlinks

    ReplyDelete
  4. ISO 27001 Certification in Saudi Arabia
    ISO 27001 Registration in Saudi Arabia could be a specification for an info security management system (ISMS) printed by the international organization for Standardization.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Plastic shopping bags have become an essential part of modern consumer life, offering a convenient and lightweight solution for carrying groceries, retail items, and personal belongings. Known for their durability and flexibility, these carry plastic bags are easy to store and reuse for various purposes. Their versatility makes them a popular choice, whether for quick trips to the store or transporting goods during everyday errands. With different sizes and strengths available, plastic shopping bags provide a practical and economical option for shoppers everywhere.

    ReplyDelete