Share Button | facebook for developers

The Share button lets people add a personalized message to links before sharing on their timeline, in groups, or to their friends via a Facebook Message.

Step-by-Step

1. Choose URL or Page

Pick the URL of a website or Facebook Page you want to share.

2. Code Configurator

Paste the URL to the Code Configurator and adjust the layout of your share button. Click the Get Code button to generate your share button code.

3. Copy & Paste HTML snippet

Copy and past the snippet into the HTML of the destination website.

Full Code Example

Copy & paste the code example to your website. Adjust the value data-href to your website URL. Next use the og:*** meta tags to adjust your link preview. og:url and data-href should use the same URL.

<html>
<head>
<title>Your Website Title</title>
<!-- You can use Open Graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url"           content="https://www.your-domain.com/your-page.html" />
<meta property="og:type"          content="website" />
<meta property="og:title"         content="Your Website Title" />
<meta property="og:description"   content="Your description" />
<meta property="og:image"         content="https://www.your-domain.com/path/image.jpg" />
</head>
<body>

<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<!-- Your share button code -->
<div class="fb-share-button" 
data-href="https://www.your-domain.com/your-page.html" 
data-layout="button_count">
</div>

</body>
</html>

source:https://developers.facebook.com/docs/plugins/share-button/

how to manage dynamic content id in facebook ads

Dynamic Ads

Dynamic Ads are ads dynamically created by populating an ad template with product information found in a data feed. This allows you to create thousands of ads without having to configure each of them individually. You can also use Dynamic Ads to target visitors based on how they have interacted with your website in the past.

The general steps for creating Dynamic Ads are:

  1. Set up conversion tracking for the specific standard events and their parameter object properties listed below, then
  2. Use the Commerce Manager to set up a dynamic ad set that targets those events

Requirements

  • You must have a Facebook Page for the business that your dynamic ads will apply to.
  • The pixel base code must already be installed.
  • You must have access to the Facebook Ads Manager.

Standard Events

Before you can set up dynamic ads, you must first be tracking the following standard events. You must also include a parameter object with specific object properties with each tracked event.

Required EventRequired Object Properties
AddToCartcontent_type and either content_ids or contents
Purchasecontent_type and either content_ids or contents
ViewContentcontent_type and either content_ids or contents

Refer to the Object Properties section below to learn what values to assign to the required object properties.

Object Properties

content_type

The content_type object property’s value must be set to either product, or product_group, depending on how you will configure your data feed when you set up your product catalog in the Commerce Manager.

If you will be tracking events associated with individual products, set the value to product. If you are tracking events associated with product groups, set it to product_group instead.

For example, here’s how you could track a visitor who has added the product with the ID 201 to a shopping cart. The ID matches the ID for that product in the product catalog.

fbq('track', 'AddToCart',
  // begin required parameter object
  {
    value: .5,
    currency: 'USD',
    content_type: 'product', // required property
    content_ids: '201' // required property, if not using 'contents' property
  }
  // end required parameter object
);

content_ids

If you are using the content_ids property in your parameter object, its value should correspond to the product ID or product IDs associated with the action. IDs must match the IDs found in your product catalog. Values can be either single IDs, or an array of IDs.

For example, here’s how to track a visitor who has added products with the IDs 201 and 301 to a shopping cart. The IDs match the IDs for those products in the product catalog.

fbq('track', 'AddToCart',
  // begin required parameter object
  {
    value: .5,
    currency: 'USD',
    content_type: 'product', // required property
    content_ids: ['201', '301'] // required property, if not using 'contents' property
  }
  // end required parameter object
);

contents

If you are using the contents property in your parameter object, in a sub-object, you must include the id property, with the product ID or product IDs as its value, and include the quantity property with a number of product items being added to cart or purchased. IDs must match the IDs found in your product catalogcontents property value must be an array of objects.

For example, here’s how to track a visitor who has added a product with the ID 301, and two products with the ID 401, to a shopping cart. The IDs match the IDs for those products in the product catalog.

fbq('track', 'AddToCart', {
  value: .5,
  currency: 'USD',
  contents: [
    {
      id: '301',
      quantity: 1
    },
    {
      id: '401',
      quantity: 2
    }],
  content_type: 'product',
});

Use the Facebook event setup tool for web

After you’ve added your Facebook pixel base code to your website, you can use the event setup tool to set up standard events and parameters without the need to code. Only standard events are available now, and not custom events.

Before you begin

  • Check that your website has a Facebook pixel installed.
  • Make sure that you have admin permissions for the pixel.
  • Turn off ad blockers in your browser.
  • Make sure that your business is not in a regulated vertical.
  • To set up content ID and content type parameters, a unique product identifier should be available either in your web page text or web page URL. For example, a product SKU or UPC. Content ID and content type parameters are only available for view content, add to cart, initiate checkout, purchase, search, add to wishlist and lead events.

Note: Facebook does not currently allow businesses in the following regulated verticals to use the event setup tool: investment banking and brokerage, insurance, financial services, retail, credit union and commercial banking, credit, financing, mortgages, pharmaceutical and health. Businesses in these verticals can set up events manually instead.

To use the event setup tool:

  1. Sign in to your Ads Manager account.
  2. Select Events Manager in the main menu.
  3. Select the pixel that you’d like to use.
  4. Click Settings.
  5. Select Open event setup tool under Event setup.
  6. Enter your URL and click Open website. The event setup tool will launch in your website browser.
  7. Click Review by each suggested event and then select Confirm or Dismiss.
  8. To add events that don’t appear in your suggested list, navigate your website as usual to find the buttons or web pages that you want. Select Track new button or Track a URL and follow the on-screen instructions.Note: When you set up an event on a button, you’re adding the event to all buttons with the same or similar text on your website.
  9. Select an event.
  10. Set up parameters for your event.
  11. Click Finish setup in the event setup tool when you’ve finished.

To view your events, go to Events Manager, select your pixel and view your event graph and table. To test that your events are firing correctly, go to Events Manager, select your pixel, click the Test events tab and follow the instructions. Learn how to use the test events tool.

print index in php twig file

The `loop` variable

Inside of a for loop block you can access some special variables:

VariableDescription
loop.indexThe current iteration of the loop. (1 indexed)
loop.index0The current iteration of the loop. (0 indexed)
loop.revindexThe number of iterations from the end of the loop (1 indexed)
loop.revindex0The number of iterations from the end of the loop (0 indexed)
loop.firstTrue if first iteration
loop.lastTrue if last iteration
loop.lengthThe number of items in the sequence
loop.parentThe parent context
{% for user in users %}
    {{ loop.index }} - {{ user.username }}
{% endfor %}

how to show subscribers on youtube

You can choose to make which channels you’re subscribed to private or public. By default, all settings are set to private. 

  • Private: When your subscriptions are set to private, no other users can see what channels you subscribe to. Your account does not show in a channel’s Subscribers List, even if you’re subscribed. 
  • Public: When your subscriptions are set to public, other users can see what channels you subscribe to. Your subscriptions are listed on your channel homepage. Your account is listed in the Subscribers List for any channel you subscribe to. 

Make your channel subscriptions public or private

  1. Sign in to YouTube.
  2. In the top right, click your profile picture .
  3. Click Settings Settings
  4. In the left Menu, select Privacy.
  5. Turn on or off Keep all my subscriptions private.

Hide your subscriber count 

By hiding your subscriber count, it won’t be publicly visible to others on YouTube. You can still see your subscriber count from YouTube Studio.

  1. Sign in to your Google Account.
  2. Go to YouTube Studio.
  3. Click Settings and then Channel and then Advanced settings.
  4. Under “Subscriber count,” uncheck “Display the number of people subscribed to my channel.”
  5. Click Save.

Email not working in CI

 $this->load->library('email');

$config['protocol']    = 'smtp';
$config['smtp_host']    = 'tls://smtp.mail.net';
$config['smtp_port']    = '465';
$config['smtp_timeout'] = '10';
$config['smtp_user']    = 'apikey';
$config['smtp_pass']    = 'SG..FRzo2eJ4e6kMPH_nadeghjdddjkkDgBOaZwX6NrPYav6eEPHUM7FNpD58';
$config['charset']    = 'utf-8';
$config['newline']    = "\r\n";
$config['mailtype'] = 'html'; // or html
$config['validation'] = TRUE; // bool whether to validate email or not   
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;  

$this->email->initialize($config);

$this->email->from('aditya@soatechnology.net', 'Laughing Adda');
$this->email->to($email); 
$this->email->subject($email_template->title);
$this->email->message($email_template->message);  

$this->email->send();

echo $this->email->print_debugger();

Multi-factor Authentication for AWS

AWS Multi-Factor Authentication (MFA) is a simple best practice that adds an extra layer of protection on top of your user name and password. With MFA enabled, when a user signs in to an AWS Management Console, they will be prompted for their user name and password (the first factor—what they know), as well as for an authentication code from their AWS MFA device (the second factor—what they have). Taken together, these multiple factors provide increased security for your AWS account settings and resources.

You can enable MFA for your AWS account and for individual IAM users you have created under your account. MFA can be also be used to control access to AWS service APIs.

After you’ve obtained a supported hardware or virtual MFA device, AWS does not charge any additional fees for using MFA.

Virtual MFA Applications

Applications for your smartphone can be installed from the application store that is specific to your phone type. The following table lists some applications for different smartphone types.

 AndroidAuthyDuo MobileLastPass AuthenticatorMicrosoft AuthenticatorGoogle Authenticator
 iPhoneAuthyDuo MobileLastPass AuthenticatorMicrosoft AuthenticatorGoogle Authenticator

source:https://aws.amazon.com/iam/features/mfa/?audit=2019q1